docs/EXPIRATION.md in lite-regulations-1.1.2 vs docs/EXPIRATION.md in lite-regulations-1.2.0
- old
+ new
@@ -1,22 +1,21 @@
# Expiration
-#### Usage
+#### Table
```ruby
-# 1. Add column to table
class AddRegulationsTimestampColumn < ActiveRecord::Migration
def change
t.datetime :expires_at
-
- # - or -
-
add_column :your_model, :expires_at, :datetime
end
end
+```
-# 2. Include module
+#### Usage
+
+```ruby
class User < ActiveRecord::Base
include Lite::Regulations::Expiration
end
```
@@ -24,17 +23,14 @@
```ruby
user = User.first
user.unexpire!
user.unexpired? #=> true
-
user.expire!
user.expired? #=> true
-
user.extend!
user.extend!(20.days)
user.expired? #=> false
-
user.to_expiration #=> Returns the visibility state locale string (ex: Expired)
```
#### Scopes