Skip to content

Commit

Permalink
Only update attributes that get changed instead of all of them (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
npezza93 authored and chrisdpeters committed Jan 18, 2017
1 parent 5ca7d67 commit 936d5a3
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 @@ -443,7 +443,7 @@ def save_only_columns_for_draft
only_changed_attributes = self.attributes.keys - self.class.draftsman_options[:only]

only_changed_attributes.each do |key|
only_changes[key] = send(key)
only_changes[key] = send(key) if changed.include?(key)
end

self.update_columns(only_changes) if only_changes.any?
Expand Down

0 comments on commit 936d5a3

Please sign in to comment.