Module: ModelActivityLogger

Extended by:
ActiveSupport::Concern
Defined in:
lib/activity_log/model_activity_logger.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#record_activity_log(action) ⇒ Object



6
7
8
9
10
# File 'lib/activity_log/model_activity_logger.rb', line 6

def record_activity_log(action)
  # if current_user_id == nil, then the User is in the process of Logging In
  current_id = defined?(current_user_id) ? current_user_id : nil
  activity_logs.create user_id: current_id, action: action, data: changes, action_type: 'model', parent_activity_id: current_parent_activity_id
end