application_extension.rb 368 B

123456789101112131415
  1. # frozen_string_literal: true
  2. module ApplicationExtension
  3. extend ActiveSupport::Concern
  4. included do
  5. validates :name, length: { maximum: 60 }
  6. validates :website, url: true, length: { maximum: 2_000 }, if: :website?
  7. validates :redirect_uri, length: { maximum: 2_000 }
  8. end
  9. def confirmation_redirect_uri
  10. redirect_uri.lines.first.strip
  11. end
  12. end