1

I have upgraded my application from Rails 2.3.5 to Rails 3.1.3. I had acts_as_commentable_with_threading and awesome_nested_set as plugins. Now I have added in GemFile for Rails 3.1.3 as below

gem 'awesome_nested_set'
gem 'acts_as_commentable_with_threading'

I have code in the model as below

class Post < ActiveRecord::Base
  acts_as_commentable
end

The migration for acts_as_commentable_with_threading is already applied in the database.

I have statement in the view as

<%= pluralize(post.root_comments.size, "comment") %> on this post

When I try to load that view I get error at that line as

uninitialized constant Post::Comment

What can be the problem. Please help me.

Thanks in advance!

1 Answers1

0

You might have forgot to run the generator and the migration afterwards:

rails generate acts_as_commentable_with_threading_migration
or
rails generate acts_as_commentable_upgrade_migration

and after:

bin/rake db:migrate

It's first steps of github repo instructions

miguelfg
  • 1,455
  • 2
  • 16
  • 21