Sha256: c5b649bb24c703559febd7d6498d581d238bde9ea6c7862c919bc5c69eff3c2f

Contents?: true

Size: 683 Bytes

Versions: 13

Compression:

Stored size: 683 Bytes

Contents

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

  scope :available, -> {where(name: ['Not For Loan', 'Limited Circulation, Normal Loan Period'])}
  has_many :item_has_use_restrictions
  has_many :items, through: :item_has_use_restrictions

  private
  def valid_name?
    true
  end
end

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
enju_circulation-0.2.0.beta.2 app/models/use_restriction.rb
enju_circulation-0.2.0.beta.1 app/models/use_restriction.rb
enju_circulation-0.1.2 app/models/use_restriction.rb
enju_circulation-0.1.1 app/models/use_restriction.rb
enju_circulation-0.1.0 app/models/use_restriction.rb
enju_circulation-0.1.0.pre49 app/models/use_restriction.rb
enju_circulation-0.1.0.pre48 app/models/use_restriction.rb
enju_circulation-0.1.0.pre47 app/models/use_restriction.rb
enju_circulation-0.1.0.pre46 app/models/use_restriction.rb
enju_circulation-0.1.0.pre45 app/models/use_restriction.rb
enju_circulation-0.1.0.pre44 app/models/use_restriction.rb
enju_circulation-0.1.0.pre43 app/models/use_restriction.rb
enju_circulation-0.1.0.pre42 app/models/use_restriction.rb