Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support Mongoid 3: references_in ==> belongs to AND references_many =…

…=> has_many
  • Loading branch information...
commit dd6eacd993eefc121887ef68af8cb541620c6ef8 1 parent f55a8d9
@burgalon authored
View
4 lib/oauth2/provider/models/mongoid/access_token.rb
@@ -10,12 +10,12 @@ module Behaviour
field :expires_at, :type => Time
field :refresh_token
- referenced_in(:authorization,
+ belongs_to(:authorization,
:class_name => OAuth2::Provider.authorization_class_name,
:foreign_key => :oauth_authorization_id
)
- referenced_in(:client,
+ belongs_to(:client,
:class_name => OAuth2::Provider.client_class_name,
:foreign_key => :oauth_client_id
)
View
6 lib/oauth2/provider/models/mongoid/authorization.rb
@@ -11,17 +11,17 @@ module Behaviour
field :resource_owner_id
field :resource_owner_type
- referenced_in(:client,
+ belongs_to(:client,
:class_name => OAuth2::Provider.client_class_name,
:foreign_key => :client_id
)
- references_many(:access_tokens,
+ has_many(:access_tokens,
:class_name => OAuth2::Provider.access_token_class_name,
:foreign_key => :oauth_authorization_id
)
- references_many(:authorization_codes,
+ has_many(:authorization_codes,
:class_name => OAuth2::Provider.authorization_code_class_name,
:foreign_key => :oauth_authorization_id
)
View
4 lib/oauth2/provider/models/mongoid/authorization_code.rb
@@ -10,12 +10,12 @@ module Behaviour
field :expires_at, :type => Time
field :redirect_uri
- referenced_in(:authorization,
+ belongs_to(:authorization,
:class_name => OAuth2::Provider.authorization_class_name,
:foreign_key => :oauth_authorization_id
)
- referenced_in(:client,
+ belongs_to(:client,
:class_name => OAuth2::Provider.client_class_name,
:foreign_key => :oauth_client_id
)
View
6 lib/oauth2/provider/models/mongoid/client.rb
@@ -11,17 +11,17 @@ module Behaviour
field :oauth_secret
field :oauth_identifier
- references_many(:authorizations,
+ has_many(:authorizations,
:class_name => OAuth2::Provider.authorization_class_name,
:foreign_key => :oauth_client_id
)
- references_many(:access_tokens,
+ has_many(:access_tokens,
:class_name => OAuth2::Provider.access_token_class_name,
:foreign_key => :oauth_client_id
)
- references_many(:authorization_codes,
+ has_many(:authorization_codes,
:class_name => OAuth2::Provider.authorization_code_class_name,
:foreign_key => :oauth_client_id
)
Please sign in to comment.
Something went wrong with that request. Please try again.