If the object has accessor methods for the create timestamp field, and the create timestamp value is nil or overwriting it is allowed, set the create timestamp field to the time given or the current time. If setting the update timestamp on creation is configured, set the update timestamp as well.
# File lib/sequel/plugins/timestamps.rb, line 84 84: def set_create_timestamp(time=nil) 85: field = model.create_timestamp_field 86: meth = :"#{field}=" 87: self.send(meth, time||=Sequel.datetime_class.now) if respond_to?(field) && respond_to?(meth) && (model.create_timestamp_overwrite? || send(field).nil?) 88: set_update_timestamp(time) if model.set_update_timestamp_on_create? 89: end
Set the update timestamp to the time given or the current time if the object has a setter method for the update timestamp field.
# File lib/sequel/plugins/timestamps.rb, line 93 93: def set_update_timestamp(time=nil) 94: meth = :"#{model.update_timestamp_field}=" 95: self.send(meth, time||Sequel.datetime_class.now) if respond_to?(meth) 96: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.