Sha256: 3a4e2a5c226ba4659b3492bb78589e72b695e1bc0dc8419755354ea9bb4c5e5c

Contents?: true

Size: 760 Bytes

Versions: 2

Compression:

Stored size: 760 Bytes

Contents

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.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_expirable-0.1.1 README.md
acts_as_expirable-0.1.0 README.md