Module: Historical::ActiveRecord::Extensions::ClassMethods

Defined in:
lib/historical/active_record.rb

Instance Method Summary collapse

Instance Method Details

#generate_historical_models!Object

Generates the customized classes (Models::ModelVersion, Models::ModelVersion::Meta, Models::ModelVersion::Diff) for this model.



34
35
36
37
38
39
40
41
42
43
# File 'lib/historical/active_record.rb', line 34

def generate_historical_models!
  builder = Historical::ClassBuilder.new(self)

  self.historical_callbacks     ||= []
  self.historical_callbacks     += builder.callbacks

  self.historical_version_class = builder.version_class
  self.historical_meta_class    = builder.meta_class
  self.historical_diff_class    = builder.diff_class
end