Excellent explanation, I guessed it must be down to something like that 
but didn't have time to muck around to find the correct solution so I 
bodged it.

I think it might be a good idea to try and get your solution integrated 
into the api documentation. I've  googled around and found other people 
wrestling with this issue and there will be more in the future. It's 
nice to have a clear explanation in the official docs.

John Small

Jamal Soueidan wrote:
> Roy Pardee wrote:
>> Well don't leave us hanging--how'd you fix it? ;-)
> 
> Sorry, I went home from work before but now I'm online again.
> 
> class Blog::Post < ActiveRecord::Base
>   belongs_to :category
> end
> 
> class Blog::Category < ActiveRecord::Base
>   has_many :posts
> end
> 
> Error:
> 
> Blog is not missing constant Post
> 
> so I just did this :)
> 
> class Blog::Post < ActiveRecord::Base
>   belongs_to :category, :class_name => "Blog::Category", :foreign_key => 
> :category_id
> end
> 
> class Blog::Category < ActiveRecord::Base
>   has_many :posts, :class_name => "Blog::Post", :foreign_key => 
> :category_id
> end
> 
> 
> and then it works :)

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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to