Skip to content

Commit

Permalink
Fix error when saving a draft when one already existed (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfederico authored and chrisdpeters committed Mar 29, 2017
1 parent 936d5a3 commit 207d158
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/draftsman/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def changes_for_draftsman(event)
if event == :update
# Collect all attributes' previous and new values.
draftable_attrs.each do |attr|
if self.draft? && self.draft.changeset.key?(attr)
if self.draft? && self.draft.changeset && self.draft.changeset.key?(attr)
the_changes[attr] = [self.draft.changeset[attr].first, send(attr)]
else
the_changes[attr] = [self.send("#{attr}_was"), send(attr)]
Expand Down

0 comments on commit 207d158

Please sign in to comment.