search for: table_a_id

Displaying 4 results from an estimated 4 matches for "table_a_id".

2006 Jul 12
2
Weird problem. How to tell if an attribute has changed? Please help.
How do you tell if an foreign key attribute has been changed? For example, lets say you have a model with attribute table_a_id. Would you do this? def table_a_id=(value) if value != table_a_id @table_a_changed = true write_attribute ''table_a_id'', value end end def table_a=(value) if value != table_a @table_a_changed = true @table_a = value end e...
2006 May 31
0
belongs_to without referencing an id as a foreign key?
Hello everyone, Here''s my problem for the day: I have three tables that look a little like the following table_a id table_b id position table_a_id name table_c id table_a_id table_b_position There will be many rows in table_c that have the same table_a_id, and the same table_b_position. These will all be referencing the same name value in table_b. The row in table_b may or may not exist, and table_b_position is a meaningful field wit...
2006 Jan 03
3
Can I map 2 tables into one class
Can I map 2 tables into one class? Is there any pattern, e.g. using ActiveRecord aggregation? Thanks Szczepan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060103/fa2aed7c/attachment.html
2005 Dec 20
7
wrong id for activerecord object when using :joins in mysql
I''m using a find with a :joins clause, like this: :joins => "JOIN table_b ON table_b.id=table_b_id" The records returned are used in a scaffold generated list page. The edit, show, and destroy links are getting the wrong id. They are getting the id of the table b record. When I run the query using mysql, I see that the query returns *2* id columns, the id of the main