class OldNode < ActiveRecord::Base
include GeoRecord
+ include ConsistencyValidations
set_table_name 'nodes'
el1['id'] = self.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?
self.tags.each do |k,v|
clear_aggregation_cache
clear_association_cache
#ok from here
- @attributes.update(OldNode.find(:first, :conditions => ['id = ? AND timestamp = ?', self.id, self.timestamp]).instance_variable_get('@attributes'))
+ @attributes.update(OldNode.find(:first, :conditions => ['id = ? AND timestamp = ? AND version = ?', self.id, self.timestamp, self.version]).instance_variable_get('@attributes'))
self.tags.each do |k,v|
tag = OldNodeTag.new