Two-way dictionary


I’m working on a multi-language idioms mapping application in which
an expression object has a habtm relation with its own class.
I thus created a table ‘expressions_dictionary’ and would go about by
declaring something like:
has_and_belongs_to_many :peers,
:class_name => “Expression”,
:join_table => “expressions_dictionary”,
:foreign_key => “id_a”,
:association_foreign_key => “id_b”
Only that this way the dictionary would only work one way ? only
finding all the Bs mapped to A but not the Bs that have A mapped to

What would be the best way to circumvent this default behaviour?

Rails mailing list
[email protected]