has_many and belongs_to how to reference the relationship both ways
I have a model invoice and a model invoice_layout.
invoice
belongs_to invoice_layout
end
(the invoice table has a invoice_layout_id)
invoice_layout
has_many invoices
end
Can I just reference invoice_layout.invoice or does it work in both
directions so that i can call invoice.invoice_layout ? If that is not
possible, how can i achieve that?
best regards denym_
No comments:
Post a Comment