Module: Mongoid::Timestamps::Timeless
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mongoid/timestamps/timeless.rb
Overview
This module adds behaviour for turning off timestamping in single or multiple calls.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#clear_timeless_option ⇒ true
Clears out the timeless option.
-
#timeless ⇒ Document
Begin an execution that should skip timestamping.
- #timeless? ⇒ Boolean
Class Method Details
.timeless_table ⇒ Object
41 42 43 |
# File 'lib/mongoid/timestamps/timeless.rb', line 41 def timeless_table Thread.current['[mongoid]:timeless'] ||= Hash.new end |
Instance Method Details
#clear_timeless_option ⇒ true
Clears out the timeless option.
18 19 20 |
# File 'lib/mongoid/timestamps/timeless.rb', line 18 def clear_timeless_option self.class.clear_timeless_option end |
#timeless ⇒ Document
Begin an execution that should skip timestamping.
30 31 32 33 |
# File 'lib/mongoid/timestamps/timeless.rb', line 30 def timeless self.class.timeless self end |
#timeless? ⇒ Boolean
35 36 37 |
# File 'lib/mongoid/timestamps/timeless.rb', line 35 def timeless? self.class.timeless? end |