I am getting `uninitialized constant Project::Forum::Topic` at
app/controllers/home_controller.rb:46:in `discussions'

I have code below and I am converting from `rails 2.3.x` to `rails 3.2.11`,
I am thinking something wrong in `routes` setting.

Any Idea How can I fix?

models

    Project < ActiveRecord::Base
      # Relations under project model
      has_many :features, :dependent => :destroy
      has_many :forums, :class_name=>'Forum::Forum'
      has_many :topics, :class_name=>'Forum::Topic', :through=>:forums

    Forum::Forum < Feature
      # Relations under forum model
      has_many :topics, :class_name => 'Forum::Topic', :dependent =>
:destroy

    Feature < ActiveRecord::Base
      # Relations under feature model
      belongs_to :project

    Forum::Topic < ActiveRecord::Base
       # Relations under topic model
       belongs_to :forum, :foreign_key => :forum_id, :class_name =>
'Forum::Forum', :include => :project

home_controller.rb

    def discussions
      @project ||= Project.find_by_name 'help'
      @forums = @project.forums
      @topics = @project.topics.recent # HERE I AM GETTING ERRORS
    end

routes.rb

    scope :home, :controller => "home", :activity => 'read' do
     get :discussions, :path => '/forums', :service_type => 'public'
     get :forums, :action => "discussions"
    end

errors
    uninitialized constant Project::Forum::Topic
    app/controllers/home_controller.rb:46:in `discussions'

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to