diff options
Diffstat (limited to 'app/models/oauth_access_token.rb')
-rw-r--r-- | app/models/oauth_access_token.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/oauth_access_token.rb b/app/models/oauth_access_token.rb index 8e79a750793..601381f1c65 100644 --- a/app/models/oauth_access_token.rb +++ b/app/models/oauth_access_token.rb @@ -4,6 +4,8 @@ class OauthAccessToken < Doorkeeper::AccessToken belongs_to :resource_owner, class_name: 'User' belongs_to :application, class_name: 'Doorkeeper::Application' + validates :expires_in, presence: true + alias_attribute :user, :resource_owner scope :latest_per_application, -> { select('distinct on(application_id) *').order(application_id: :desc, created_at: :desc) } |