Sha256: 59082cba6dd2316924c6be9d115f8ac4bf613593e4a4dd5534c389a20d34b34d

Contents?: true

Size: 729 Bytes

Versions: 8

Compression:

Stored size: 729 Bytes

Contents

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

  validates :item_id,
    uniqueness: true, #{ message: I18n.t('withdraw.already_withdrawn', locale: I18n.default_locale) },
    presence: true #, { message: I18n.translate('withdraw.item_not_found', locale: I18n.default_locale) }
  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

8 entries across 8 versions & 1 rubygems

Version Path
enju_library-0.3.11 app/models/withdraw.rb
enju_library-0.3.10 app/models/withdraw.rb
enju_library-0.3.9 app/models/withdraw.rb
enju_library-0.3.8 app/models/withdraw.rb
enju_library-0.3.8.rc.2 app/models/withdraw.rb
enju_library-0.3.8.rc.1 app/models/withdraw.rb
enju_library-0.3.7 app/models/withdraw.rb
enju_library-0.3.6 app/models/withdraw.rb