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

7 lines
258 B
Plaintext
Raw Permalink Normal View History

2023-07-20 16:55:22 +02:00
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