class ChangesetTag < ActiveRecord::Base
- set_primary_keys :changeset_id, :k
+ self.primary_keys = "changeset_id", "k"
belongs_to :changeset
class Language < ActiveRecord::Base
- set_primary_key :code
+ self.primary_key = "code"
has_many :diary_entries, :foreign_key => 'language'
include GeoRecord
include ConsistencyValidations
- set_table_name 'current_nodes'
+ self.table_name = "current_nodes"
belongs_to :changeset
class NodeTag < ActiveRecord::Base
- set_table_name 'current_node_tags'
- set_primary_keys :node_id, :k
+ self.table_name = "current_node_tags"
+ self.primary_keys = "node_id", "k"
belongs_to :node
include GeoRecord
include ConsistencyValidations
- set_table_name 'nodes'
- set_primary_keys :node_id, :version
+ self.table_name = "nodes"
+ self.primary_keys = "node_id", "version"
validates_presence_of :changeset_id, :timestamp
validates_inclusion_of :visible, :in => [ true, false ]
class OldNodeTag < ActiveRecord::Base
- set_table_name 'node_tags'
- set_primary_keys :node_id, :version, :k
+ self.table_name = "node_tags"
+ self.primary_keys = "node_id", "version", "k"
belongs_to :old_node, :foreign_key => [:node_id, :version]
class OldRelation < ActiveRecord::Base
include ConsistencyValidations
- set_table_name 'relations'
- set_primary_keys :relation_id, :version
+ self.table_name = "relations"
+ self.primary_keys = "relation_id", "version"
belongs_to :changeset
class OldRelationMember < ActiveRecord::Base
- set_table_name 'relation_members'
- set_primary_keys :relation_id, :version, :sequence_id
+ self.table_name = "relation_members"
+ self.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
class OldRelationTag < ActiveRecord::Base
- set_table_name 'relation_tags'
- set_primary_keys :relation_id, :version, :k
+ self.table_name = "relation_tags"
+ self.primary_keys = "relation_id", "version", "k"
belongs_to :old_relation, :foreign_key => [:relation_id, :version]
class OldWay < ActiveRecord::Base
include ConsistencyValidations
- set_table_name 'ways'
- set_primary_keys :way_id, :version
+ self.table_name = "ways"
+ self.primary_keys = "way_id", "version"
belongs_to :changeset
class OldWayNode < ActiveRecord::Base
- set_table_name 'way_nodes'
- set_primary_keys :way_id, :version, :sequence_id
+ self.table_name = "way_nodes"
+ self.primary_keys = "way_id", "version", "sequence_id"
belongs_to :old_way, :foreign_key => [:way_id, :version]
# A bit messy, referring to current nodes and ways, should do for the data browser for now
class OldWayTag < ActiveRecord::Base
- set_table_name 'way_tags'
- set_primary_keys :way_id, :version, :k
+ self.table_name = "way_tags"
+ self.primary_keys = "way_id", "version", "k"
belongs_to :old_way, :foreign_key => [:way_id, :version]
include ConsistencyValidations
- set_table_name 'current_relations'
+ self.table_name = "current_relations"
belongs_to :changeset
class RelationMember < ActiveRecord::Base
- set_table_name 'current_relation_members'
- set_primary_keys :relation_id, :sequence_id
+ self.table_name = "current_relation_members"
+ self.primary_keys = "relation_id", "sequence_id"
belongs_to :relation
belongs_to :member, :polymorphic => true
class RelationTag < ActiveRecord::Base
- set_table_name 'current_relation_tags'
- set_primary_keys :relation_id, :k
+ self.table_name = "current_relation_tags"
+ self.primary_keys = "relation_id", "k"
belongs_to :relation
class Trace < ActiveRecord::Base
- set_table_name 'gpx_files'
+ self.table_name = "gpx_files"
belongs_to :user
has_many :tags, :class_name => 'Tracetag', :foreign_key => 'gpx_id', :dependent => :delete_all
class Tracepoint < ActiveRecord::Base
include GeoRecord
- set_table_name 'gps_points'
+ self.table_name = "gps_points"
validates_numericality_of :trackid, :only_integer => true
validates_numericality_of :latitude, :only_integer => true
class Tracetag < ActiveRecord::Base
- set_table_name 'gpx_file_tags'
+ self.table_name = "gpx_file_tags"
validates_format_of :tag, :with => /^[^\/;.,?]*$/
validates_length_of :tag, :within => 1..255
class UserPreference < ActiveRecord::Base
- set_primary_keys :user_id, :k
+ self.primary_keys = "user_id", "k"
+
belongs_to :user
validates_length_of :k, :within => 1..255
include ConsistencyValidations
- set_table_name 'current_ways'
+ self.table_name = "current_ways"
belongs_to :changeset
class WayNode < ActiveRecord::Base
- set_table_name 'current_way_nodes'
- set_primary_keys :way_id, :sequence_id
+ self.table_name = "current_way_nodes"
+ self.primary_keys = "way_id", "sequence_id"
belongs_to :way
belongs_to :node
class WayTag < ActiveRecord::Base
- set_table_name 'current_way_tags'
- set_primary_keys :way_id, :k
+ self.table_name = "current_way_tags"
+ self.primary_keys = "way_id", "k"
belongs_to :way