belongs_to :invoice_address, :class_name => “Address”, …
belongs_to :delivery_address, :class_name => “Address”, …
belongs_to :contact, :class_name => “Employee”, …
How would you go about filtering a find :all where e.g.
invoice_address.city = “Oslo”, delivery_address.zip = 1234 and
contact.department = 14?
Exactly which and how many fields we want to filter on is highly
dynamic. Doing it in the db is a must.