Infrastructure connection updates
This commit is contained in:
+6
-4
@@ -26,16 +26,18 @@ class User
|
||||
validates_uniqueness_of :email
|
||||
before_save :ensure_authentication_token
|
||||
|
||||
has_many :error_logs
|
||||
#has_many :error_logs
|
||||
has_many :user_feedbacks
|
||||
|
||||
view :by_authentication_token, key: :authentication_token
|
||||
view :by_email, key: :email
|
||||
view :by_facebook, key: [:provider, :uid] #DEPRICATE on successful change to by_provider
|
||||
view :by_provider, key: [:provider, :uid]
|
||||
#view :by_facebook, key: [:provider, :uid] #DEPRICATE on successful change to by_provider
|
||||
#view :by_provider, key: [:provider, :uid]
|
||||
view :by_provider_and_uid, key: [:provider, :uid]
|
||||
|
||||
def self.find_for_oauth(auth_data, user)
|
||||
user = database.view(self.by_provider(key: [auth_data.provider, auth_data.uid], limit: 1)).first
|
||||
#user = database.view(self.by_provider(key: [auth_data.provider, auth_data.uid], limit: 1)).first
|
||||
user = find_by_provider_and_uid(auth_data.provider, auth_data.uid)
|
||||
|
||||
user || create(
|
||||
provider: auth_data.provider,
|
||||
|
||||
Reference in New Issue
Block a user