Fix error resolving relation parents

It's not entirely clear why specifying the foreign key explicitly
fixes this - the value given is what it should default to - but
without this it finds the child relation instead when looking at
the parents of a relation.

Fixes #789
This commit is contained in:
Tom Hughes 2014-07-24 00:23:45 +01:00
parent 0b9bf8d816
commit c72940684e
4 changed files with 62 additions and 1 deletions

View file

@ -2,6 +2,6 @@ class RelationMember < ActiveRecord::Base
self.table_name = "current_relation_members"
self.primary_keys = "relation_id", "sequence_id"
belongs_to :relation
belongs_to :relation, :foreign_key => :relation_id
belongs_to :member, :polymorphic => true
end