sean.swolfe / gmail.com wrote:
> I have a layered one to many relationship situation that is having some
> weird problems. I've been trying to look for a solution but I can't
> seem to find it, or am not certain what keywords I should search on.
> 
> Okay lets explain the environment. A Ruby on Rails app, simple CMS.
> Just some little tweaks. But versioning needs to be supported, and some
> articles require that the body can have multiple pages. Also the
> Articles can have multiple types, so they use a Single table
> inheritance scheme.
>
> <snip>
> 
> Now the problem is, on the line "@version.article_pages << page", I get
> the following error:
> undefined method `article_pages' for Version:Class
>
> <snip>
> 
> Anyone else run into this problem? Is there a solution? Is this a bug,
> or by some sort of wicked design?

The 'Version:Class' is your best clue: it means that instead of
Version.new.article_pages you are calling Version.article_pages.
From this we can extrapolate that you are for some reason assigning
the class (or retrieving the class) rather than an instance thereof.


In any case, you may have better luck on the Rails mailing list:

  http://lists.rubyonrails.org/mailman/listinfo/rails


> Thanks,
> 
> Sean


E

-- 
Posted via http://www.ruby-forum.com/.