Sha256: 84199a176464c3bad9ed5d4faaeb4c418ae611eaad4e23984ceca81cf9f2e6a0
Contents?: true
Size: 692 Bytes
Versions: 11
Compression:
Stored size: 692 Bytes
Contents
module EnjuCirculation module EnjuAccept def self.included(base) base.extend ClassMethods end module ClassMethods def enju_circulation_accept_model include InstanceMethods before_save :accept!, on: :create end end module InstanceMethods def accept! circulation_status = CirculationStatus.where(name: 'Available On Shelf').first item.update_column(:circulation_status_id, circulation_status.id) if circulation_status use_restriction = UseRestriction.where(name: 'Limited Circulation, Normal Loan Period').first item.use_restriction = use_restriction if use_restriction end end end end
Version data entries
11 entries across 11 versions & 1 rubygems