Module: Snaptime::Versioned::Scopes

Extended by:
ActiveSupport::Concern
Included in:
Snaptime::Versioned
Defined in:
lib/snaptime/versioned/scopes.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#all_versionsObject



53
54
55
# File 'lib/snaptime/versioned/scopes.rb', line 53

def all_versions
  self.class.unscoped.where('natural_id = ?', natural_id)
end

#at_snaptimeObject



49
50
51
# File 'lib/snaptime/versioned/scopes.rb', line 49

def at_snaptime
  _at_explicit_snaptime Snaptime.snaptime
end

#snaptimesObject



39
40
41
# File 'lib/snaptime/versioned/scopes.rb', line 39

def snaptimes
  Harvester.harvest_for(self)
end

#with_snaptime(snaptime = nil) ⇒ Object



43
44
45
46
47
# File 'lib/snaptime/versioned/scopes.rb', line 43

def with_snaptime(snaptime = nil)
  Snaptime.with_snaptime(snaptime) do
    yield at_snaptime
  end
end