43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'app/models/concerns/journaled/changes.rb', line 43
def update_columns(attributes, opts = { force: false })
unless opts[:force] || self.class.journaled_attribute_names.empty?
conflicting_journaled_attribute_names = self.class.journaled_attribute_names & attributes.keys.map(&:to_sym)
raise(" #update_columns aborted by Journaled::Changes due to journaled attributes:\n\n \#{conflicting_journaled_attribute_names.join(', ')}\n\n Call #update instead to ensure journaling or invoke #update_columns\n with additional arg `{ force: true }` to override and skip journaling.\n ERROR\n end\n super(attributes)\nend\n") if conflicting_journaled_attribute_names.present?
|