Do not set id if id is not given.
This commit is contained in:
parent
b8bab889a5
commit
1d03fcfc55
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue