]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/old_way.rb
Add a test to check the validity of the translations
[rails.git] / app / models / old_way.rb
index c2af4f21ce45e2944146fecc370ded8b4d56a2e4..db8a6df4061ae3f8d60194c86c885f29462d95a5 100644 (file)
@@ -1,8 +1,8 @@
 class OldWay < ActiveRecord::Base
   include ConsistencyValidations
   
-  set_table_name 'ways'
-  set_primary_keys :way_id, :version
+  self.table_name = "ways"
+  self.primary_keys = "way_id", "version"
 
   belongs_to :changeset
 
@@ -137,7 +137,7 @@ class OldWay < ActiveRecord::Base
       id = n; reuse = curnode.visible
       if oldnode.lat != curnode.lat or oldnode.lon != curnode.lon or oldnode.tags != curnode.tags then
         # node has changed: if it's in other ways, give it a new id
-        if curnode.ways-[self.node_id] then id=-1; reuse=false end
+        if curnode.ways-[self.way_id] then id=-1; reuse=false end
       end
       points << [oldnode.lon, oldnode.lat, id, curnode.version, oldnode.tags_as_hash, reuse]
     end