Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 670 Bytes

QUARANTINE.md

File metadata and controls

38 lines (30 loc) · 670 Bytes

Quarantine

Table

class AddRegulationsTimestampColumn < ActiveRecord::Migration
  def change
    t.datetime :quarantined_at
    add_column :your_model, :quarantined_at, :datetime
  end
end

Usage

class User < ActiveRecord::Base
  include Lite::Regulations::Quarantine
end

Methods

user = User.first
user.unquarantine!
user.unquarantined? #=> true
user.quarantine!
user.quarantined?   #=> true
user.to_quarantine  #=> Returns the visibility state locale string (ex: Quarantined)

Scopes

User.unquarantined  # Returns all unquarantined records
User.quarantined    # Returns all quarantined records