search for: country_inst

Displaying 1 result from an estimated 1 matches for "country_inst".

2006 May 23
0
does has_many: add a has_<associated_class>? method
Hi, I have a Country class which has_many: regions. At the same time, the corresponding countries table has a boolean column named has_regions. It happens that when I try to access that attribute using country_instance.has_regions? , I can see in the logs that Rails is querying the database with a SELECT that''s counting the regions in that country. Obviously, that''s not what I want, as I already have the required info in the has_regions column, so there''s no need to make a d...