wasshiwa
wasshiwa

Reputation: 296

Rails 3, Awesome Nested Set, undefined method `parent_id_changed?' for #<Post:0x56f87d0>

I've installed Awesome Nested Set, but something weird happens when I try to create any object that has acts_as_nested_set.

 undefined method `parent_id_changed?' for #<Post:0x5671830>

in this line:

 @post = Post.create!(params[:post])

Similarly, I get undefined method `parent_id_changed?' for comments and nested comments:

 @comment = Comment.create!(params[:comment])
 @comment.move_to_child_of(@post)

Upvotes: 1

Views: 1276

Answers (1)

Ryan Bigg
Ryan Bigg

Reputation: 107728

It looks like you're missing a field called parent_id on the comments table.

Upvotes: 1

Related Questions