Module: ChronoModel::TimeGate

Extended by:
ActiveSupport::Concern
Includes:
Patches::AsOfTimeHolder
Defined in:
lib/chrono_model/time_gate.rb

Overview

Provides the TimeMachine API to non-temporal models that associate temporal ones.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from Patches::AsOfTimeHolder

#as_of_time, #as_of_time!

Instance Method Details

#as_of(time) ⇒ Object


19
20
21
# File 'lib/chrono_model/time_gate.rb', line 19

def as_of(time)
  self.class.as_of(time).where(:id => self.id).first!
end

#timelineObject


23
24
25
# File 'lib/chrono_model/time_gate.rb', line 23

def timeline
  self.class.timeline(self)
end