mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-28 09:24:24 +01:00
[bug] filename too long error on GET api/trainings
This commit is contained in:
parent
77c7a41761
commit
3e44d62aac
@ -1,5 +1,9 @@
|
||||
# Changelog Fab Manager
|
||||
|
||||
## next release
|
||||
|
||||
- Fix a bug: on some linux hosts, a filename too long error is triggered when accessing the trainings API
|
||||
|
||||
## v2.5.9 2017 July 13
|
||||
|
||||
- Fixed invalid syntax for configuration file application.yml.default
|
||||
|
@ -1,9 +1,7 @@
|
||||
role = (current_user and current_user.is_admin?) ? 'admin' : 'user'
|
||||
|
||||
json.cache! [@trainings, role] do
|
||||
json.array!(@trainings) do |training|
|
||||
json.extract! training, :id, :name, :description, :machine_ids, :nb_total_places, :slug
|
||||
json.training_image training.training_image.attachment.large.url if training.training_image
|
||||
json.plan_ids training.plan_ids if role === 'admin'
|
||||
end
|
||||
json.array!(@trainings) do |training|
|
||||
json.extract! training, :id, :name, :description, :machine_ids, :nb_total_places, :slug
|
||||
json.training_image training.training_image.attachment.large.url if training.training_image
|
||||
json.plan_ids training.plan_ids if role === 'admin'
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user