[% SET did_header = 0 %] [% FOR accessor_type IN [ 'belongs_to', 'might_have', 'has_one', 'has_many', 'many_to_many' ] %] [% SET relationships = [] %] [% FOR rel IN source.relationships %] [% IF rel.type == accessor_type %] [% relationships.push( rel ) %] [% END %] [% END %] [% NEXT UNLESS relationships.size %] [% UNLESS did_header %]
| Name | [% IF accessor_type == 'many_to_many' %]Link Rel | Foreign Rel | [% ELSE %]Foreign Class | Join Condition | [% END %]
|---|---|---|---|---|
| [% name %] | [% IF accessor_type == 'many_to_many' %][% link_rel_name %] | [% foreign_rel_name %] | [% ELSE %] [% SET fm = foreign_moniker %][% fm %] | [% FOR key IN cond.keys %] [% key %] => [% cond.$key %] [% UNLESS loop.last %], [% END %] [% END %] | [% END %]