views:

18

answers:

1

That is, if you have all the has_many, has_one, belongs_to, and has many ... :through and has_many_and_belongs_to wrong, but your program only touch the

model.instance_variable

but not

model.some_other_model    # or model.some_other_model.some_method_or_variable

will you app do anything wrong or do anything bad to the database? That is, if your association is defined wrong, will it not do anything wrong if you keep to that model but not "cross reference" another model?

+1  A: 

Assuming the syntax is correct, an error about a bad association won't be thrown until you try to access that association.

rspeicher
i think if you happen to have that key in either of your table, then you may not even see an error, such as matching the wrong primary key or foreign key by the wrong field.
動靜能量