Displaying 1 result from an estimated 1 matches for "as_b".
Did you mean:
asb
2006 May 17
2
Association data clobbering (foreign keys too?)
Can someone please confirm or correct the following statements?
If I have the following tables
create table as (id int, [...], b_id int);
create table bs (id int, [...], a_id int);
create table as_bs (a_id int, b_id int);
and the associations woould be defined like this
class A << ...
habtm :bs
belongs_to :b
end
so my Model A has a habtm collection of Bs *plus* a direct belongs_to
link to one B (and vice versa).
So
a = A.find(:first)
b = a.bs.first
a2 = b.a
might not give...