Я не знаю, когда это произошло, но я получаю эту ошибку NoMethodError (undefined method 'to_key' for :user:Symbol)
Такое поведение имеет место только в стеке Heroku Cedar. Я использую Devise (1.4.2) для аутентификации через Facebook на Rails 3.1.0.rc6 и ruby 1.9.2-p290. Это происходит на линии с sign_in_and_redirect(:user, authentication.user)
. Вот мой метод:
def create
omniauth = request.env['omniauth.auth']
authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])
if !authentication.nil?
flash[:notice] = I18n.t('devise.omniauth_callbacks.success', kind: omniauth['provider'])
sign_in_and_redirect(:user, authentication.user)
elsif current_user
current_user.authentications.create!(provider: omniauth['provider'], uid: omniauth['uid'])
redirect_to profile_path, notice: I18n.t('devise.omniauth_callbacks.success', kind: omniauth['provider'])
else
user = User.new
user.apply_omniauth(omniauth)
if user.save
flash[:notice] = I18n.t('devise.omniauth_callbacks.success', kind: omniauth['provider'])
sign_in_and_redirect(:user, user)
else
session[:omniauth] = omniauth.except('extra')
redirect_to new_user_registration_url
end
end
end