问题
I'm studying Devise + omniauth. In most examples I find method User.find_for_oauth
Where can I find docs for this method & its ins and outs? Is it provided by Devise or omniauth gems?
here and here are some examples where I came across it.
回答1:
The User.find_for_oauth() isn't provided by Devise or Omniauth. It's something you have to provide.
Have another look at the examples in the links you gave. They show code for find_for_auth. The first link has it in the app/models/user.rb code in the Basic Implementation section. The second has it in an ActiveRecordHelpers class which they include in their User model.
来源:https://stackoverflow.com/questions/25598220/user-find-for-oauth-where-can-i-find-it