From 18633b7c9e66a7f25dafa68c7bc2d90885a61789 Mon Sep 17 00:00:00 2001 From: Matt Amos Date: Sun, 29 Mar 2009 02:14:40 +0000 Subject: [PATCH] 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. --- app/controllers/amf_controller.rb | 4 ++-- app/models/node.rb | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) 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 -- 2.43.2