lib/paper_trail/record_trail.rb
# Like the `update_columns` method from `ActiveRecord::Persistence`, but also
# creates a version to record those changes.
# @api public
Like the `update_columns` method from `ActiveRecord::Persistence`, but also
creates a version to record those changes.
Like the ` update_columns ` method from ` ActiveRecord :: Persistence ` but also creates a version to record those changes .
def update_columns(attributes)
      changes = {}
      attributes.each do |k, v|
        changes[k] = [@record[k], v]
      end
      @record.update_columns(attributes)
      record_update_columns(changes)
    end
def update_columns ( attributes ) changes = { } attributes . each do | k , v | changes [ k ] = [ @record [ k ] , v ] end @record . update_columns ( attributes ) record_update_columns ( changes ) end
Like the `update_columns` method from `ActiveRecord::Persistence`, but also
creates a version to record those changes.
Like the ` update_columns ` method from ` ActiveRecord :: Persistence ` but also creates a version to record those changes .
# `@record.update_columns` skips dirty tracking, so we can't just use `@record.changes` or # @record.saved_changes` from `ActiveModel::Dirty`. We need to build our own hash with the # changes that will be made directly to the database.
attributes
<not_specific>
api
None