Sha256: 32f940f2780cb543303c8337121b95276dd21842a915b93ea81da62b6c78cd4a

Contents?: true

Size: 706 Bytes

Versions: 11

Compression:

Stored size: 706 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  module Models
    module PolymorphicResourceOwner
      module ForAccessGrant
        extend ActiveSupport::Concern

        included do
          if Doorkeeper.config.polymorphic_resource_owner?
            belongs_to :resource_owner, polymorphic: true, optional: false
          else
            validates :resource_owner_id, presence: true
          end
        end
      end

      module ForAccessToken
        extend ActiveSupport::Concern

        included do
          if Doorkeeper.config.polymorphic_resource_owner?
            belongs_to :resource_owner, polymorphic: true, optional: true
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
doorkeeper-5.8.1 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb
doorkeeper-5.8.0 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb
doorkeeper-5.7.1 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb
doorkeeper-5.7.0 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb
doorkeeper-5.6.9 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb
doorkeeper-5.6.8 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb
doorkeeper-5.6.7 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb
doorkeeper-5.6.6 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb
doorkeeper-5.6.5 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb
doorkeeper-5.6.4 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb
doorkeeper-5.6.3 lib/doorkeeper/models/concerns/polymorphic_resource_owner.rb