unepwcmc/SAPI

View on GitHub
app/models/document_tag.rb

Summary

Maintainability
A
0 mins
Test Coverage
# == Schema Information
#
# Table name: document_tags
#
#  id         :integer          not null, primary key
#  name       :text             not null
#  type       :string(255)
#  created_at :datetime         not null
#  updated_at :datetime         not null
#

class DocumentTag < ApplicationRecord
  # Only created by seed and rake task.
  # attr_accessible :name

  has_and_belongs_to_many :documents

  scope :review_phases, -> { where(type: 'DocumentTag::ReviewPhase') }
  scope :process_stages, -> { where(type: 'DocumentTag::ProcessStage') }
  scope :proposal_outcomes, -> { where(type: 'DocumentTag::ProposalOutcome') }
end