app/models/ibrain/auth/user.rb in ibrain-auth-0.2.5 vs app/models/ibrain/auth/user.rb in ibrain-auth-0.2.6

- old
+ new

@@ -38,9 +38,16 @@ end.join(' OR ') where(query).first end end + + def social_find_or_initialize(params) + user = find_by(provider: params[:provider], uid: params[:uid]) + return user if user.present? + + create!(params) + end end end end end