Module: Historical

Defined in:
lib/historical.rb,
lib/historical/railtie.rb,
lib/historical/active_record.rb,
lib/historical/class_builder.rb,
lib/historical/model_history.rb,
lib/historical/mongo_mapper_enhancements.rb

Overview

Main module for the Historical gem

Defined Under Namespace

Modules: ActiveRecord, Models, MongoMapperEnhancements Classes: ClassBuilder, ImmediateLoader, ModelHistory, Railtie

Constant Summary collapse

IGNORED_ATTRIBUTES =
[:id]
@@historical_models =
[]
@@booted =
false

Class Method Summary collapse

Class Method Details

.boot!Object

Generates all customized models.



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/historical.rb', line 27

def self.boot!
  return if booted?
  
  Historical::Models::Pool.clear!
  Historical::Models::AttributeDiff.generate_subclasses!
  
  historical_models.each do |model|
    model.generate_historical_models!
  end
  
  @@booted = true
  @@historical_models = ImmediateLoader.new
end

.booted?Boolean

Returns:

  • (Boolean)


24
# File 'lib/historical.rb', line 24

def self.booted?; @@booted; end