未初始化的常量User :: Authorization | omn​​iauth

时间:2014-01-27 21:02:16

标签: ruby-on-rails facebook oauth ruby-on-rails-4 omniauth

我按照上一个问题的答案 - > Connect Twitter Account to existing Devise Account

但是得到了

NameError in Devise::Registrations#edit
uninitialized constant User::Authorization

app/models/user.rb:17:in `has_connection_with'
app/helpers/users_helper.rb:4:in `check_connection'
app/views/devise/registrations/edit.html.erb:57:in `_app_views_devise_registrations_edit_html_erb__1951492867192219113_70202479591960'

我正在努力修复它,但没有。我错过了什么?

1 个答案:

答案 0 :(得分:1)

Authorization模型缺失或AuthorizationUser之间的关系丢失。

User应该有多个authorizationsauthorization属于user