I am going to add doubly polymorphic associations to the has_many_polymorphs plugin. They will continue to support self-reference and directionality.
possible API
class ChaseRelationship < ActiveRecord::Base
has_many_polymorphs :join_class => self, :reflective => false,
:parent_key => 'chaser', :child_key => 'chasee',
:parents => [:dogs, :cats, :birds],
:children => :parents
end
Stay tuned. I need to decide what the API will be, because it won’t make sense to specify the relationship in a master model class anymore, since no class will have priority (except, possibly, the join class).
Is ‘directionality’ a real word, even? ‘Bi-direction’, maybe.
Also, if you missed it, I changed the license for has_many_polymorphs
to the Academic License 3.0 a while ago, and the minor version was bumped. Functionality did not change.