Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

Commit 80003de

Browse files
committed
fdf
1 parent bd43812 commit 80003de

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/checkout_helper.rb

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# frozen_string_literal: true
22
class CheckoutHelper
33
def self.checkout_reservation(r, reservations)
4-
r.save!
5-
# update equipment item notes
6-
new_notes = reservations[r.id.to_s][:notes]
7-
r.equipment_item.make_reservation_notes('checked out', r,
8-
r.checkout_handler,
9-
new_notes, r.checked_out)
4+
check_reservation(r, reservations, 'checked out',
5+
r.checkout_handler, r.checked_out)
106
end
117

128
def self.checkin_reservation(r, reservations)
9+
check_reservation(r, reservations, 'checked in',
10+
r.checkin_handler, r.checked_in)
11+
end
12+
13+
def self.check_reservation(r, reservations, message, handler, time)
1314
r.save!
14-
# update equipment item notes
1515
new_notes = reservations[r.id.to_s][:notes]
16-
r.equipment_item.make_reservation_notes('checked in', r,
17-
r.checkin_handler, new_notes,
18-
r.checked_in)
16+
r.equipment_item.make_reservation_notes(message, r,
17+
handler,
18+
new_notes, time)
1919
end
2020

2121
def self.reservation_for(r_id, r_attrs, user)

0 commit comments

Comments
 (0)