Skip to content

Commit

Permalink
Fix syntax of index method in AccessToken
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Paul Lussier committed Sep 14, 2012
1 parent 63966b0 commit 1b19a76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/doorkeeper/models/mongoid/access_token.rb
Expand Up @@ -8,15 +8,15 @@ class AccessToken
include Doorkeeper::Models::Mongoid::Revocable
include Doorkeeper::Models::Mongoid::Scopes

self.store_in :oauth_access_tokens
self.store_in :collection => 'oauth_access_tokens'

field :resource_owner_id, :type => Integer
field :token, :type => String
field :expires_in, :type => Integer
field :revoked_at, :type => DateTime

index :token, :unique => true
index :refresh_token, :unique => true, :sparse => true
index({:token => 1}, {:unique => true})
index({:refresh_token => 1}, {:unique => true, :sparse => true})

def self.last_authorized_token_for(application, resource_owner_id)
where(:application_id => application.id,
Expand Down

0 comments on commit 1b19a76

Please sign in to comment.