1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-30 19:52:20 +01:00
fab-manager/app/views/api/machines/_machine.json.jbuilder
Sylvain 7868f31a58 (feat) advanced accounting parameters
for: machines, spaces, trainings, events
2022-12-21 14:05:15 +01:00

18 lines
518 B
Ruby

# frozen_string_literal: true
json.extract! machine, :id, :name, :slug, :disabled
if machine.machine_image
json.machine_image_attributes do
json.id machine.machine_image.id
json.attachment_name machine.machine_image.attachment_identifier
json.attachment_url machine.machine_image.attachment.url
end
end
if machine.advanced_accounting
json.advanced_accounting_attributes do
json.partial! 'api/advanced_accounting/advanced_accounting', advanced_accounting: machine.advanced_accounting
end
end