Hi,
There are 3 models: A has_many :Cs B has_many :Cs C belongs_to A and B
I got a single object of A and an array of B objects. How can I get all Cs that have a_id equal to object A.id *and* b_id that belongs to an object in Bs array?
Regards
Hi,
There are 3 models: A has_many :Cs B has_many :Cs C belongs_to A and B
I got a single object of A and an array of B objects. How can I get all Cs that have a_id equal to object A.id *and* b_id that belongs to an object in Bs array?
Regards
Hi,
There are 3 models: A has_many :Cs B has_many :Cs C belongs_to A and B
I got a single object of A and an array of B objects. How can I get all Cs that have a_id equal to object A.id *and* b_id that belongs to an object in Bs array?
C.find_all_by_a_id_and_b_id(A.id, [some_objects])
should work
Fred
Thanks! I had no idea you can pass an array of AR objects to find_by_something_id.