开发者

Rails getting undefined method for existing field in database

开发者 https://www.devze.com 2023-02-11 12:15 出处:网络
So I have a field in 开发者_JAVA技巧the question table, called is_public..I migrated my database, restarted it and now when I get this error everytime I call is_public for a record in the question rec

So I have a field in 开发者_JAVA技巧the question table, called is_public..I migrated my database, restarted it and now when I get this error everytime I call is_public for a record in the question records.

undefined method `is_public' for #<Question:0x7e9aa780>

Any ideas to why this is happening ?


Not sure if this was the issue, but I had the same problem, and it looks like somehow my schema.rb file was changed, removing that column.

I manually added it back, and the error went away.


Are you using attr_accessible? If so, add :is_public to the list.

0

精彩评论

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