Sha256: 2bc65fb70d6411f44ca4fc20ebaaff77f0a46b59fe4f27584f7f4a2ef3acea09

Contents?: true

Size: 557 Bytes

Versions: 9

Compression:

Stored size: 557 Bytes

Contents

module Georgia
  class Status < ActiveRecord::Base

    PUBLISHED = 'Published'
    DRAFT = 'Draft'
    PENDING_REVIEW = 'Pending Review'

    has_many :pages

    attr_accessible :name, :label, :icon

    validates :name, presence: true

    scope :published, where(name: PUBLISHED)
    scope :draft, where(name: DRAFT)
    scope :pending_review, where(name: PENDING_REVIEW)

    def published?
      self.name == PUBLISHED
    end
    def draft?
      self.name == DRAFT
    end
    def pending_review?
      self.name == PENDING_REVIEW
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
georgia-0.7.8 app/models/georgia/status.rb
georgia-0.7.7 app/models/georgia/status.rb
georgia-0.7.6 app/models/georgia/status.rb
georgia-0.7.5 app/models/georgia/status.rb
georgia-0.7.4 app/models/georgia/status.rb
georgia-0.7.3 app/models/georgia/status.rb
georgia-0.7.2 app/models/georgia/status.rb
georgia-0.7.1 app/models/georgia/status.rb
georgia-0.7.0 app/models/georgia/status.rb