No commit activity in last 3 years
No release in over 3 years
With ActsAsExpirable, you can mark ActiveRecord records as expired and programmatically find expired record.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.3.7
>= 0

Runtime

 Project Readme

Acts As Expirable

acts_as_expirable is an ActiveRecord mixin that enables simple handling of expiring records. It gives you expired and unexpired scopes as well as global handling of all expirable classes.

Usage

class SomeModel < ActiveRecord::Base
  acts_as_expirable
end

Configuration Options

To add configuration options, simply add a Hash of options to the acts_as_expirable call:

...
acts_as_expirable column: 'some_timestamp', default: ->(r) { Time.now + 1.day }

Options

  • column - the name of the ORM's field that you want to treat as the expiry time.
  • default - a default value to set on create if the expiry field is not yet set. Can be a value or a proc, yielding the record instance.