Browse Source

Do not set id if id is not given.

Martin Edenhofer 11 years ago
parent
commit
1d03fcfc55
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/models/history.rb

+ 3 - 1
app/models/history.rb

@@ -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