1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

UsersCredits::Manager is more strict about arguments that have to be passed

This commit is contained in:
Nicolas Florentin 2016-04-08 11:11:42 +02:00
parent dbe8d42663
commit d22574dae4

View File

@ -15,7 +15,11 @@ module UsersCredits
@manager = Managers::Training.new(reservation, plan) @manager = Managers::Training.new(reservation, plan)
elsif reservation.reservable_type == "Machine" elsif reservation.reservable_type == "Machine"
@manager = Managers::Machine.new(reservation, plan) @manager = Managers::Machine.new(reservation, plan)
else
raise ArgumentError, "reservation.reservable_type must be Training or Machine"
end end
else
raise ArgumentError, "you have to pass either a reservation or a user to initialize a UsersCredits::Manager"
end end
end end