openstreetmap-website/app/models/old_relation_member.rb
Tom Hughes fc25c3d412 Rename all ID columns that aren't unique
Having a table with a column called ID that is only part of the
primary key really doesn't work as rails likes to treat ID as a
special name so it becomes impossible to assign to it or read it.
2011-11-14 09:42:52 +00:00

8 lines
343 B
Ruby

class OldRelationMember < ActiveRecord::Base
set_table_name 'relation_members'
set_primary_keys :relation_id, :version, :sequence_id
belongs_to :old_relation, :foreign_key => [:relation_id, :version]
# A bit messy, referring to the current tables, should do for the data browser for now
belongs_to :member, :polymorphic => true
end