Module: Overule::RuleActivityBehavior

Extended by:
ActiveSupport::Concern
Included in:
RuleActivity
Defined in:
app/models/concerns/overule/rule_activity_behavior.rb

Constant Summary collapse

ACTIONS =
%w[created updated destroyed].freeze

Instance Method Summary collapse

Instance Method Details

#changed_fieldsObject



14
15
16
17
18
# File 'app/models/concerns/overule/rule_activity_behavior.rb', line 14

def changed_fields
  return [] unless action == "updated"

  diff.keys
end

#snapshotObject



20
21
22
# File 'app/models/concerns/overule/rule_activity_behavior.rb', line 20

def snapshot
  diff["snapshot"] if %w[created destroyed].include?(action)
end