Sha256: aabdbc5d770d424eeafe157ed00a52299e84b66faa38693b7bed977cb58c559d

Contents?: true

Size: 673 Bytes

Versions: 4

Compression:

Stored size: 673 Bytes

Contents

# Activation

#### Usage

```ruby
# 1. Add column to table
class AddRegulationsTimestampColumn < ActiveRecord::Migration
  def change
    t.datetime :inactivated_at

    # - or -

    add_column :your_model, :inactivated_at, :datetime
  end
end

# 2. Include module
class User < ActiveRecord::Base
  include Lite::Regulations::Activation
end
```

#### Methods

```ruby
user = User.first
user.inactive!
user.inactive?      #=> true

user.active!
user.active?        #=> true

user.to_activation  #=> Returns the visibility state locale string (ex: Active)
```

#### Scopes

```ruby
User.inactive # Returns all inactive records
User.active   # Returns all active records
```

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lite-regulations-1.1.2 docs/ACTIVATION.md
lite-regulations-1.1.1 docs/ACTIVATION.md
lite-regulations-1.1.0 docs/ACTIVATION.md
lite-regulations-1.0.0 docs/ACTIVATION.md