Sha256: b99757d39ec384906718ad780e6d984c73acecd63541d512405ace82329a4c59
Contents?: true
Size: 532 Bytes
Versions: 16
Compression:
Stored size: 532 Bytes
Contents
module Doorkeeper module Models module Ownership extend ActiveSupport::Concern included do belongs_to_options = { polymorphic: true } if defined?(ActiveRecord::Base) && ActiveRecord::VERSION::MAJOR >= 5 belongs_to_options[:optional] = true end belongs_to :owner, belongs_to_options validates :owner, presence: true, if: :validate_owner? end def validate_owner? Doorkeeper.configuration.confirm_application_owner? end end end end
Version data entries
16 entries across 16 versions & 1 rubygems