Module: ActsAsLoggable::Base

Defined in:
app/models/concerns/acts_as_loggable.rb

Instance Method Summary collapse

Instance Method Details

#log_changes(*options) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/models/concerns/acts_as_loggable.rb', line 7

def log_changes(*options)
  @acts_as_loggable_options = options.try(:first) || {}

  unless @acts_as_loggable_options.kind_of?(Hash)
    raise ArgumentError.new('invalid arguments passed to (effective_logging) log_changes. Example usage: log_changes except: [:created_at]')
  end

  if (unknown = (@acts_as_loggable_options.keys - [:to, :prefix, :only, :except])).present?
    raise ArgumentError.new("unknown keyword: #{unknown.join(', ')}")
  end

  include ::ActsAsLoggable
end