openstreetmap-website/app/models/relation_member.rb
Tom Hughes c72940684e 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
2014-07-24 00:23:45 +01:00

7 lines
241 B
Ruby

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