开发者

Rails 3.0.9 Model attributes are lost on database query

开发者 https://www.devze.com 2023-04-09 03:21 出处:网络
If i open the console and type in the following code, my model looses attributes. In all cases only the first attribute after the id is accessable. I had this problem on one server. My old server is w

If i open the console and type in the following code, my model looses attributes. In all cases only the first attribute after the id is accessable. I had this problem on one server. My old server is working fine with the same code and same versions. Here the output:

irb(main):001:0> User.new 
=> 开发者_JS百科#<User id: nil, encrypted_uid: nil, encrypted_access_token: nil, created_at: nil, updated_at: nil>
irb(main):002:0> User.first
=> #<User id: 1, encrypted_uid: "I7lPHOYoGMNWki3cZtb5oA==\n">

ActiveModel::MissingAttributeError (missing attribute: encrypted_access_token):

Has anyone an idea to get it working? Thanks in advance.


I had to recreate the application and copy the model into hte new application. after that everything worked fine. No clue what was wrong.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号