Module: TemporalScopes::HasTemporalScopes::InstanceMethods
- Defined in:
- lib/temporal_scopes/has_temporal_scopes.rb
Overview
The following instance methods are added to ActiveRecord::Base objects, which classes have been called has_temporal_scopes on.
Instance Method Summary collapse
-
#archive(params = {}) ⇒ ActiveRecord::Base
Archives an object, that is, makes it a past object.
Instance Method Details
#archive(params = {}) ⇒ ActiveRecord::Base
Archives an object, that is, makes it a past object.
119 120 121 122 123 124 125 |
# File 'lib/temporal_scopes/has_temporal_scopes.rb', line 119 def archive(params = {}) unless self.valid_to archive_at = params[:at] || Time.zone.now update_attribute(:valid_to, archive_at) end return self end |