未定义的方法`initialize_attributes'当object.new时## class>

时间:2016-08-09 02:35:42

标签: ruby-on-rails

当我将rails从4.0.0更新到4.2.x(我试过4.2.1和4.2.7)时,每个模型的新方法都会提出一个Expection:

[10] pry(main)> User
=> User(id: integer, email: string, encrypted_password: string, reset_password_token: string, reset_password_sent_at: datetime, remember_created_at: datetime, sign_in_count: integer, current_sign_in_at: datetime, last_sign_in_at: datetime, current_sign_in_ip: string, last_sign_in_ip: string, created_at: datetime, updated_at: datetime, admin: boolean, name: string, sex: integer, phone: string, created_by_id: integer, current_project: integer, avatar_file_name: string, avatar_content_type: string, avatar_file_size: integer, avatar_updated_at: datetime)

[11] pry(main)>u = User.new
NoMethodError (undefined method `initialize_attributes' for #<Class:0x007f9bcda69710>

但是当我使用rails 4.0.0时,一切正常。

有人可以帮助我吗,thx

0 个答案:

没有答案