Now...only the street_id key is set in the house record...But not
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 ?)
Now...only the street_id key is set in the house record...But not
city_id and country_id...
Is there an ORM way to let active record do the job ?
That is the ORM way. The problem lies in your design (i.e.
associations).
A country has many cities. Cities have many streets. These streets
contain houses.
Sure a house belongs to a city, but given the additional entities
involved the above model makes more sense.