module Mongoid::Timestamps::Timeless::ClassMethods
Public Instance Methods
clear_timeless_option()
click to toggle source
# File lib/mongoid/timestamps/timeless.rb, line 66 def clear_timeless_option if counter = Timeless[name] counter -= 1 Timeless[name] = (counter == 0) ? nil : counter end true end
timeless()
click to toggle source
Begin an execution that should skip timestamping.
@example Create a document but don't timestamp.
Person.timeless.create(:title => "Sir")
@return [ Class ] The class this was called on.
@since 2.3.0
# File lib/mongoid/timestamps/timeless.rb, line 58 def timeless counter = 0 counter += 1 if self < Mongoid::Timestamps::Created counter += 1 if self < Mongoid::Timestamps::Updated Timeless[name] = counter self end
timeless?()
click to toggle source
# File lib/mongoid/timestamps/timeless.rb, line 74 def timeless? !!Timeless[name] end