Sha256: 6f621cb19c13a66c694be682b2debc5941ee7db8277baaf66f5f6f8d1872f64b
Contents?: true
Size: 683 Bytes
Versions: 9
Compression:
Stored size: 683 Bytes
Contents
class UseRestriction < 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, -> {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 not null # display_name :text # note :text # position :integer # created_at :datetime # updated_at :datetime #
Version data entries
9 entries across 9 versions & 1 rubygems