+
+ def save_with_dependencies!
+ save!
+ #not sure whats going on here
+ clear_aggregation_cache
+ clear_association_cache
+ #ok from here
+ @attributes.update(OldNode.where(:node_id => self.node_id, :timestamp => self.timestamp, :version => self.version).first.instance_variable_get('@attributes'))
+
+ self.tags.each do |k,v|
+ tag = OldNodeTag.new
+ tag.k = k
+ tag.v = v
+ tag.node_id = self.node_id
+ tag.version = self.version
+ tag.save!
+ end
+ end
+
+ def tags
+ unless @tags
+ @tags = Hash.new
+ OldNodeTag.where(:node_id => self.node_id, :version => self.version).each do |tag|
+ @tags[tag.k] = tag.v
+ end
+ end
+ @tags = Hash.new unless @tags
+ @tags
+ end
+
+ def tags=(t)
+ @tags = t
+ end
+
+ def tags_as_hash
+ return self.tags
+ end
+
+ # Pretend we're not in any ways
+ def ways
+ return []
+ end
+
+ # Pretend we're not in any relations
+ def containing_relation_members
+ return []
+ end
+
+ # check whether this element is the latest version - that is,
+ # has the same version as its "current" counterpart.
+ def is_latest_version?
+ current_node.version == self.version
+ end