From: Matt Amos Date: Sun, 29 Mar 2009 02:14:40 +0000 (+0000) Subject: Fixed a problem where rails was setting the ID column to null, which violates the... X-Git-Tag: live~7557^2~41 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/18633b7c9e66a7f25dafa68c7bc2d90885a61789 Fixed a problem where rails was setting the ID column to null, which violates the not-null constraint. Also fixed possible typo in AMF controller. --- diff --git a/app/controllers/amf_controller.rb b/app/controllers/amf_controller.rb index e701f2170..1ee5e9cee 100644 --- a/app/controllers/amf_controller.rb +++ b/app/controllers/amf_controller.rb @@ -490,8 +490,8 @@ class AmfController < ApplicationController new_relation.changeset_id = changeset_id new_relation.version = version - - if id <= 0 + # NOTE: id or relid here? id doesn't seem to be set above + if relid <= 0 # We're creating the node new_relation.create_with_history(user) elsif visible diff --git a/app/models/node.rb b/app/models/node.rb index 679048b4e..f6726f91a 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -171,7 +171,6 @@ class Node < ActiveRecord::Base def create_with_history(user) check_create_consistency(self, user) - self.id = nil self.version = 0 self.visible = true