From e5d407b1ce64ed165d0d28966d6fe9fea137d271 Mon Sep 17 00:00:00 2001 From: Taylor Griffin Date: Sat, 10 Jan 2015 15:35:54 +1100 Subject: [PATCH] replace depricated method --- app/controllers/authentications_controller.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/controllers/authentications_controller.rb b/app/controllers/authentications_controller.rb index 898310a3b..ee82bd9e8 100644 --- a/app/controllers/authentications_controller.rb +++ b/app/controllers/authentications_controller.rb @@ -27,12 +27,17 @@ class AuthenticationsController < ApplicationController name = auth['info']['name'] end - @authentication = current_member.authentications.find_or_create_by_provider_and_uid( - :provider => auth['provider'], - :uid => auth['uid'], + @authentication = current_member.authentications + .create_with( :name => name, :token => auth['credentials']['token'], - :secret => auth['credentials']['secret']) + :secret => auth['credentials']['secret'] + ) + .find_or_create_by( + :provider => auth['provider'], + :uid => auth['uid'], + :name => name) + flash[:notice] = "Authentication successful." else flash[:notice] = "Authentication failed."