This module adds behaviour for turning off timestamping in single or multiple calls.
Clears out the timeless option.
@example Clear the timeless option.
document.clear_timeless_option
@return [ true ] True.
@since 3.1.4
# File lib/mongoid/timestamps/timeless.rb, line 22 def clear_timeless_option self.class.timestamping = true end
Begin an execution that should skip timestamping.
@example Save a document but don't timestamp.
person.timeless.save
@return [ Document ] The document this was called on.
@since 2.3.0
# File lib/mongoid/timestamps/timeless.rb, line 34 def timeless self.class.timestamping = false self end