validates_presence_of :changeset_id, :timestamp
validates_inclusion_of :visible, :in => [ true, false ]
validates_numericality_of :latitude, :longitude
validate :validate_position
validates_presence_of :changeset_id, :timestamp
validates_inclusion_of :visible, :in => [ true, false ]
validates_numericality_of :latitude, :longitude
validate :validate_position
el1['lat'] = self.lat.to_s
el1['lon'] = self.lon.to_s
el1['changeset'] = self.changeset.id.to_s
el1['lat'] = self.lat.to_s
el1['lon'] = self.lon.to_s
el1['changeset'] = self.changeset.id.to_s
- el1['user'] = self.changeset.user.display_name if self.changeset.user.data_public?
+ if self.changeset.user.data_public?
+ el1['user'] = self.changeset.user.display_name
+ el1['uid'] = self.changeset.user.id.to_s
+ end
- @attributes.update(OldNode.find(:first, :conditions => ['id = ? AND timestamp = ? AND version = ?', self.id, self.timestamp, self.version]).instance_variable_get('@attributes'))
+ @attributes.update(OldNode.where('id = ? AND timestamp = ? AND version = ?', self.id, self.timestamp, self.version).first.instance_variable_get('@attributes'))
- OldNodeTag.find(:all, :conditions => ["id = ? AND version = ?", self.id, self.version]).each do |tag|
+ OldNodeTag.where("id = ? AND version = ?", self.id, self.version).each do |tag|