Frederick Cheung wrote:
> On 8 Mar 2009, at 15:11, Ruby Newbie wrote:
> 
>> class City < ActiveRecord::Base
>>
>> class House < ActiveRecord::Base
>>    belongs_to :country
>>    belongs_to :cities
>>    belongs_to :streets
>> end
> 
> First off, watch those belongs_to - they should be singluar, ie
> belongs_to :street.
>> city_id and country_id...
>> Is there an ORM way to let active record do the job ?
>>
> No. activerecord assumes the simple case ie that the has_many/
> belongs_to relationship between street and house is all that it needs
> (and why do you need to duplicate data between street and house ?
> surely the country and city of the house is implicit from the street ?)
> 
> Fred

Your post made it clear to me... Just a beginner...:(

Thanks
-- 
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 [email protected]
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