Skip to content

Commit

Permalink
Reverted reject_change? check to old style
Browse files Browse the repository at this point in the history
  • Loading branch information
schinery committed Aug 22, 2022
1 parent 1a5882a commit bc42eb1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/logga/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ def field_changes_to_message(changes)
def reject_change?(key)
sym_key = key.to_sym
return allowed_fields.exclude?(sym_key) if allowed_fields.present?
return true if config_excluded_fields.include?(sym_key)
return true if config_excluded_suffixes.any? { |suffix| key.to_s.end_with?(suffix.to_s) }

fields.exclude?(sym_key) && excluded_fields.include?(sym_key)
config_excluded_fields.include?(sym_key) ||
(fields.exclude?(sym_key) &&
(excluded_fields.include?(sym_key) ||
config_excluded_suffixes.any? { |suffix| key.to_s.end_with?(suffix.to_s) }))
end

def should_log?
Expand Down

0 comments on commit bc42eb1

Please sign in to comment.