Displaying 3 results from an estimated 3 matches for "table_b_id".
Did you mean:
table_a_id
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 table, and the id of...
2006 Aug 15
1
sorting attribute in list from foreign table
Hello, I currently have two tables.
table_a (
id
table_b_id
other_attrs
)
table b (
id
name
)
So table A holds an id from table B. During the listing of tuples in
table A, it lists table A''s attributes. In place of the table B id, I
check the id, and instead display the name corresponding to that id. Now
I want to be able to sort the lis...
2006 May 31
0
belongs_to without referencing an id as a foreign key?
...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 with or without a corresponding row in table_b, so these
two reasons keep me from using table_b_id within table_c. The natural
relationship here is for table_c to belong_to table_b, but I do not know how
to do this. Any ideas?
Thanks!
Zack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060531/f8ea42d7/...