include ConsistencyValidations
include NotRedactable
- include ObjectMetadata
self.table_name = "current_relations"
:numericality => { :on => :update, :only_integer => true }
validates :version, :presence => true,
:numericality => { :only_integer => true }
- validates :changeset_id, :presence => true,
- :numericality => { :only_integer => true }
validates :timestamp, :presence => true
validates :changeset, :associated => true
validates :visible, :inclusion => [true, false]
end
def tags
- @tags ||= Hash[relation_tags.collect { |t| [t.k, t.v] }]
+ @tags ||= relation_tags.to_h { |t| [t.k, t.v] }
end
attr_writer :members, :tags
end
def preconditions_ok?(good_members = [])
+ raise OSM::APITooManyRelationMembersError.new(id, members.length, Settings.max_number_of_relation_members) if members.length > Settings.max_number_of_relation_members
+
# These are hastables that store an id in the index of all
# the nodes/way/relations that have already been added.
# If the member is valid and visible then we add it to the
private
def save_with_history!
- t = Time.now.getutc
+ t = Time.now.utc
self.version += 1
self.timestamp = t