Sha256: 1f3420b510124987fa5fc34cc3d95b6e12cc3f58ad3425f4b89a9937bf56fb5e

Contents?: true

Size: 361 Bytes

Versions: 6

Compression:

Stored size: 361 Bytes

Contents

module Doorkeeper
  module Models
    module Ownership
      def validate_owner?
        Doorkeeper.configuration.confirm_application_owner?
      end

      def self.included(base)
        base.class_eval do
          belongs_to :owner, polymorphic: true
          validates :owner, presence: true, if: :validate_owner?
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
doorkeeper-1.4.2 lib/doorkeeper/models/ownership.rb
doorkeeper-1.4.1 lib/doorkeeper/models/ownership.rb
doorkeeper-1.4.0 lib/doorkeeper/models/ownership.rb
doorkeeper-1.3.1 lib/doorkeeper/models/ownership.rb
doorkeeper-1.3.0 lib/doorkeeper/models/ownership.rb
doorkeeper-1.2.0 lib/doorkeeper/models/ownership.rb