Joined December 2011
·

Guilherme Souza

Passionate developer at Globo.com
·
Brasil, Rio de Janeiro
·
·

The where on User, would raise a ActiveModel::ForbiddenAttributesError,
so it should be written like this:

where(provider: auth.provider, uid: auth.uid).firstorcreate do |user|

and the controller should had:

private

def userparams
params.require(:user).permit(:provider, :uid, :name, :oauth
token, :oauthexpiresat)
end

Achievements
89 Karma
0 Total ProTip Views