I am having a problem with an association:
Battalion :has_many soldiers
Soldiers :has_many primaries
I need to do this @bseniorleads=(@user.battalion.soldiers.find(:all, :conditions => ["seniorleader = ?", "Yes"])) then @seniorspouse=(@bseniorleads.primaries.find(:all, :conditions => ["relationship = ?", "Spouse"]
This gives me an undefined method for primaries, I assume because the bseniorleads is an array?
Basically I don't know how to do this they right way but I need to be able to query a group from one model that meets a condition and then take that result and find the people from another model that belong to them. Any ideas?
Thanks in advance.