Sha256: 09343e83cb129e6113096c9f38c8321071e038a36fbb6e56468f5cbd653b74c9

Contents?: true

Size: 731 Bytes

Versions: 2

Compression:

Stored size: 731 Bytes

Contents

class CirculationStatus < ActiveRecord::Base
  attr_accessible :name, :display_name, :note
  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(255)      not null
#  display_name :text
#  note         :text
#  position     :integer
#  created_at   :datetime         not null
#  updated_at   :datetime         not null
#

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
enju_circulation-0.1.0.pre40 app/models/circulation_status.rb
enju_circulation-0.1.0.pre39 app/models/circulation_status.rb