1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-11 22:24:21 +01:00
fab-manager/app/views/api/reservation_contexts/index.json.jbuilder
Nicolas Florentin 043ff6d47e wip
2023-07-20 16:55:22 +02:00

7 lines
258 B
Ruby

user_is_admin = (current_user and current_user.admin?)
json.array!(@reservation_contexts) do |reservation_context|
json.extract! reservation_context, :id, :name, :applicable_on
json.related_to reservation_context.reservations.count if user_is_admin
end