Sha256: 3b4b7e4b0f4e5849c9fb1a04fb2cf12f786f69ed83cfd7ca8a1af5262a37ece1

Contents?: true

Size: 651 Bytes

Versions: 6

Compression:

Stored size: 651 Bytes

Contents

class CirculationStatus < ActiveRecord::Base
  include MasterModel
  validates :name, presence: true, format: { with: /\A[0-9A-Za-z][0-9A-Za-z_\-\s,]*[0-9a-z]\Z/ }

  default_scope { order('circulation_statuses.position') }
  scope :available_for_checkout, -> { where(name: 'Available On Shelf') }
  has_many :items

  private

  def valid_name?
    true
  end
end

# == Schema Information
#
# Table name: circulation_statuses
#
#  id           :integer          not null, primary key
#  name         :string           not null
#  display_name :text
#  note         :text
#  position     :integer
#  created_at   :datetime
#  updated_at   :datetime
#

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
enju_circulation-0.3.3 app/models/circulation_status.rb
enju_circulation-0.3.2 app/models/circulation_status.rb
enju_circulation-0.3.1 app/models/circulation_status.rb
enju_circulation-0.3.0 app/models/circulation_status.rb
enju_circulation-0.3.0.rc.1 app/models/circulation_status.rb
enju_circulation-0.3.0.beta.1 app/models/circulation_status.rb