module PublicActivity::Update

Handles creation of Activities upon destruction and update of tracked model.

Private Instance Methods

activity_on_update() click to toggle source

Creates activity upon modification of the tracked model

# File lib/public_activity/actions/update.rb, line 15
def activity_on_update
  # Either use #changed? method for Rails < 5.1 or #saved_changes? for recent versions
  create_activity(:update) if respond_to?(:saved_changes?) ? saved_changes? : changed?
end