Skip to content

Commit bf0c30b

Browse files
committed
Merge branch 'dev' for release 6.3.36
2 parents 9a26554 + d7d81e3 commit bf0c30b

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Next release
44

5+
## v6.3.36 2024 December 12
6+
7+
- Improvement: default order for the spaces/trainings list is set to descending by created_at
8+
- Improvement: members cannot see training deactivated in the list
9+
510
## v6.3.35 2024 November 13
611

712
- Fix a bug: unable to run rails db:migrate if the database is empty

app/controllers/api/spaces_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class API::SpacesController < API::APIController
77
respond_to :json
88

99
def index
10-
@spaces = Space.includes(:space_image, :machines).where(deleted_at: nil)
10+
@spaces = Space.includes(:space_image, :machines).where(deleted_at: nil).order(:created_at)
1111
@spaces_indexed_with_parent = @spaces.index_with { |space| @spaces.find { |s| s.id == space.parent_id } }
1212
@spaces_grouped_by_parent_id = @spaces.group_by(&:parent_id)
1313
end

app/controllers/api/trainings_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def index
1414

1515
def show
1616
@training = Training.friendly.find(params[:id])
17+
authorize @training
1718
end
1819

1920
def create

app/policies/training_policy.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ def resolve
88
end
99
end
1010

11+
def show?
12+
!record.disabled? || user.admin? || user.manager?
13+
end
14+
1115
def create?
1216
user.admin?
1317
end

app/services/training_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class TrainingService
55
class << self
66
# @param filters [ActionController::Parameters]
77
def list(filters)
8-
trainings = Training.includes(:training_image, :plans, :machines)
8+
trainings = Training.includes(:training_image, :plans, :machines).order(:created_at)
99

1010
trainings = filter_by_disabled(trainings, filters)
1111
trainings = filter_by_public_page(trainings, filters)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fab-manager",
3-
"version": "6.3.35",
3+
"version": "6.3.36",
44
"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.",
55
"keywords": [
66
"fablab",

0 commit comments

Comments
 (0)