Do not set id if id is not given.

This commit is contained in:
Martin Edenhofer 2013-05-27 09:25:34 +02:00
parent b8bab889a5
commit 1d03fcfc55

View file

@ -54,7 +54,9 @@ class History < ApplicationModel
history_record.update_attributes(record)
else
record_new = History.create(record)
record_new.id = record[:id]
if record[:id]
record_new.id = record[:id]
end
record_new.save
end
end