开发者

acts_as_revisable 'loses' previous models created before migration

开发者 https://www.devze.com 2022-12-31 18:10 出处:网络
I have the following the standard, regular post sample app. I created some posts then decided to introduce acts_as_revisable

I have the following the standard, regular post sample app.

I created some posts then decided to introduce acts_as_revisable

After following the instructions at http://github.com/rich/acts_as_revisable I see that the previous posts are not appearing in the Post.all call.

However, if I use the console and do Post.find_by_sql("SELECT * FROM Post WHERE ID=1") the post shows up.

Any idea开发者_运维问答s?

Thanks


So the problem was with the migration.

the version i have is:

add_column :companies, :revisable_is_current, :boolean => 1

But it should be

add_column :companies, :revisable_is_current, :boolean => 't'
0

精彩评论

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