Skip to content

Commit

Permalink
always exclude certain keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ltello committed Mar 21, 2019
1 parent 6ff301a commit f1b0f53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/logga/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def log_model_deletion

def log_model_changes
field_changes = previous_changes.reject do |k, _|
!log_fields.include?(k.to_sym) &&
(excluded_fields.include?(k.to_sym) ||
EXCLUDED_KEYS.include?(k.to_sym) ||
EXCLUDED_KEYS_SUFFIXES.any? { |suffix| k.to_s.end_with?(suffix.to_s) })
EXCLUDED_KEYS.include?(k.to_sym) ||
(!log_fields.include?(k.to_sym) &&
(excluded_fields.include?(k.to_sym) ||
EXCLUDED_KEYS_SUFFIXES.any? { |suffix| k.to_s.end_with?(suffix.to_s) }))
end
log_field_changes(field_changes)
end
Expand Down

0 comments on commit f1b0f53

Please sign in to comment.