Sha256: 04c749eda0ff647ae331beb3c71d0282c1fde1e4ae36d7436d49b32d66fb00f2

Contents?: true

Size: 799 Bytes

Versions: 1

Compression:

Stored size: 799 Bytes

Contents

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

  scope :available_for_checkout, -> { where(name: 'Available On Shelf') }
  has_many :items
  translates :display_name

  private

  def valid_name?
    true
  end
end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enju_circulation-0.4.0.rc.1 app/models/circulation_status.rb