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
- #all_versions ⇒ Object
- #at_snaptime ⇒ Object
- #snaptimes ⇒ Object
- #with_snaptime(snaptime = nil) ⇒ Object
Instance Method Details
#all_versions ⇒ Object
53 54 55 |
# File 'lib/snaptime/versioned/scopes.rb', line 53 def all_versions self.class.unscoped.where('natural_id = ?', natural_id) end |
#at_snaptime ⇒ Object
49 50 51 |
# File 'lib/snaptime/versioned/scopes.rb', line 49 def at_snaptime _at_explicit_snaptime Snaptime.snaptime end |
#snaptimes ⇒ Object
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 |