Module: ModelTimeline::Timelineable

Extended by:
ActiveSupport::Concern
Defined in:
lib/model_timeline/timelineable.rb

Overview

Provides timeline tracking functionality for ActiveRecord models. When included in a model, this module allows tracking changes to model attributes over time by creating timeline entries.

Examples:

Basic usage

class User < ApplicationRecord
  has_timeline
end

With custom options

class Product < ApplicationRecord
  has_timeline :product_history,
              only: [:name, :price],
              on: [:update, :destroy]
end

Class Method Summary collapse

Class Method Details

.clear_loggers!Object



27
28
29
# File 'lib/model_timeline/timelineable.rb', line 27

def self.clear_loggers!
  logger_store.clear
end

.logger_storeObject



23
24
25
# File 'lib/model_timeline/timelineable.rb', line 23

def self.logger_store
  @logger_store ||= {}
end