Hay fellow developer,
When I invoke @chapter.articles, rails yields the following error:
uninitialized constant Sommaire::Chapter::Article
Event if I specify *:class_name => "Sommaire::Article"*, it yields:
uninitialized constant Sommaire::Chapter::Sommaire::Article
Since I'm relatively new to rails (3.0.0), this has lost me !
Thanks in advance for your help. JD
Below the code from the classes
in sommaire.rb
class Sommaire < ActiveRecord::Base
has_many :chapters
end
in sommaire/chapter.rb
class Sommaire::Chapter < ActiveRecord::Base
include ItemBase
def self.table_name
'sommaire_chapters'
end
belongs_to :sommaire
has_many :articles, :class_name => "Sommaire::Article"
validates_presence_of :title, :description
end
in sommaire/article.rb
class Sommaire::Article < ActiveRecord::Base
include ItemBase
def self.table_name
'sommaire_articles'
end
belongs_to :chapter
end