Sha256: f13e178614f850da9058b968e469120c2520c658d34f78ff5cb146f5e188a968

Contents?: true

Size: 724 Bytes

Versions: 5

Compression:

Stored size: 724 Bytes

Contents

class Withdraw < ActiveRecord::Base
  belongs_to :basket
  belongs_to :item, touch: true
  belongs_to :librarian, class_name: 'User'

  enju_circulation_withdraw_model if defined?(EnjuCirculation)

  validates_uniqueness_of :item_id, message:  I18n.t('withdraw.already_withdrawn')
  validates_presence_of :item_id, message:  I18n.t('withdraw.item_not_found')
  validates_presence_of :basket_id

  attr_accessor :item_identifier

  paginates_per 10
end

# == Schema Information
#
# Table name: withdraws
#
#  id           :integer          not null, primary key
#  basket_id    :integer
#  item_id      :integer
#  librarian_id :integer
#  created_at   :datetime         not null
#  updated_at   :datetime         not null
#

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
enju_library-0.1.2 app/models/withdraw.rb
enju_library-0.1.1 app/models/withdraw.rb
enju_library-0.1.0 app/models/withdraw.rb
enju_library-0.1.0.pre45 app/models/withdraw.rb
enju_library-0.1.0.pre44 app/models/withdraw.rb