Skip to content

Commit

Permalink
Re-added log_field_changes method
Browse files Browse the repository at this point in the history
  • Loading branch information
schinery committed Mar 27, 2019
1 parent 3d6f61e commit 0b753c3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/logga/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ def add_log_entries_for(*actions, to: :self, fields: {}, exclude_fields: [])
end
end

def log_field_changes(changes)
return if changes.blank?

body = field_changes_to_message(changes)
create_log_entry(author_data.merge(body: body)) if body.present?
end

def log_model_creation
return if should_not_log?

Expand Down

0 comments on commit 0b753c3

Please sign in to comment.