Added min_lat > max_lat test.
[rails.git] / lib / consistency_validations.rb
index 4becce89c44d41653b90443f83c643ca326207cb..8fd6c257d732d30d219df8ac0e2df12185ab4ed2 100644 (file)
@@ -16,4 +16,15 @@ module ConsistencyValidations
       raise OSM::APIChangesetAlreadyClosedError.new
     end
   end
       raise OSM::APIChangesetAlreadyClosedError.new
     end
   end
+  
+  # This is similar to above, just some validations don't apply
+  def check_create_consistency(new, user)
+    if new.changeset.nil?
+      raise OSM::APIChangesetMissingError.new
+    elsif new.changeset.user_id != user.id
+      raise OSM::APIUserChangesetMismatchError.new
+    elsif not new.changeset.is_open?
+      raise OSM::APIChangesetAlreadyClosedError.new
+    end
+  end
 end
 end