-class OldNode < GeoRecord
- set_primary_keys :id, :version
+class OldNode < ActiveRecord::Base
+ include GeoRecord
+
set_table_name 'nodes'
validates_presence_of :user_id, :timestamp
errors.add_to_base("Node is not in the world") unless in_world?
end
- def in_world?
- return false if self.lat < -90 or self.lat > 90
- return false if self.lon < -180 or self.lon > 180
- return true
- end
-
def self.from_node(node)
old_node = OldNode.new
old_node.latitude = node.latitude
def tags=(t)
@tags = t
- end
+ end
+ def tags_as_hash
+ hash = {}
+ Tags.split(self.tags) do |k,v|
+ hash[k] = v
+ end
+ hash
+ 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
end