Sha256: 247a985bed6f1088380cf12489d59ab2149b5e0ef0960d138f2df02104c63566
Contents?: true
Size: 811 Bytes
Versions: 3
Compression:
Stored size: 811 Bytes
Contents
module Doorkeeper class AccessGrant include OAuth::Helpers include Models::Expirable include Models::Revocable include Models::Accessible include Models::Scopes belongs_to :application, class_name: 'Doorkeeper::Application', inverse_of: :access_grants if ::Rails.version.to_i < 4 || defined?(ProtectedAttributes) attr_accessible :resource_owner_id, :application_id, :expires_in, :redirect_uri, :scopes end validates :resource_owner_id, :application_id, :token, :expires_in, :redirect_uri, presence: true validates :token, uniqueness: true before_validation :generate_token, on: :create def self.authenticate(token) where(token: token).first end private def generate_token self.token = UniqueToken.generate end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
doorkeeper-1.4.2 | lib/doorkeeper/models/access_grant.rb |
doorkeeper-1.4.1 | lib/doorkeeper/models/access_grant.rb |
doorkeeper-1.4.0 | lib/doorkeeper/models/access_grant.rb |