1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

Merge branch 'dev' for release 4.4.3

This commit is contained in:
Sylvain 2020-05-25 11:23:46 +02:00
commit 9966801faa
4 changed files with 21 additions and 2 deletions

View File

@ -1,5 +1,10 @@
# Changelog Fab-manager
## v4.4.3 2020 May 25
- Fix a bug: recurrent availabilities do not keep the custom duration
- [TODO DEPLOY] `rails fablab:fix:availabilities_duration`
## v4.4.2 2020 May 19
- Upgraded to ruby 2.6.5

View File

@ -21,7 +21,8 @@ class Availabilities::CreateAvailabilitiesService
training_ids: availability.training_ids,
space_ids: availability.space_ids,
tag_ids: availability.tag_ids,
nb_total_places: availability.nb_total_places
nb_total_places: availability.nb_total_places,
slot_duration: availability.slot_duration
).save!
end
end

View File

@ -174,5 +174,18 @@ namespace :fablab do
sp.save!
end
end
desc '[release 4.4.3] fix duration of recurring availabilities'
task availabilities_duration: :environment do
Availability.select(:occurrence_id).where(is_recurrent: true).group(:occurrence_id).each do |a|
occurrences = Availability.where(occurrence_id: a.occurrence_id)
next unless occurrences.map(&:slot_duration).uniq.size > 1
duration = occurrences.map(&:slot_duration).uniq.detect { |e| !e.nil? }
occurrences.each do |o|
o.update_attributes(slot_duration: duration)
end
end
end
end
end

View File

@ -1,6 +1,6 @@
{
"name": "fab-manager",
"version": "4.4.2",
"version": "4.4.3",
"description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.",
"keywords": [
"fablab",