Skip to content

Commit

Permalink
Merge pull request #66 from gencat/fix/decorators
Browse files Browse the repository at this point in the history
Fix decorator for Zeitwerk
  • Loading branch information
laurajaime authored Sep 5, 2024
2 parents 6956ee6 + 51cf81a commit 602ccc3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Following Semantic Versioning 2.

## next version:

## Version 0.7.1 (PATCH)
- Fix Zeitwerk errors with decorators

## Version 0.7.0 (MINOR)
- Increase minimum Decidim version to v0.27.6
- Upgrade Ruby to 3.0.7
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ GIT
PATH
remote: .
specs:
decidim-department_admin (0.7.0)
decidim-department_admin (0.7.1)
decidim-admin (~> 0.27.0)
decidim-core (~> 0.27.0)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module Decidim::ParticipatorySpaceResourceableDecorator
module Lib::Decidim::ParticipatorySpaceResourceableDecorator
#
# This decorator overrided method to avoid .to_sym error when logged in user is Department Admin
# Override affects only line `case role_name&.to_sym`
Expand Down Expand Up @@ -30,4 +30,4 @@ def user_role_config_for(user, role_name)
end
end

::Decidim::ParticipatorySpaceResourceableDecorator.decorate
::Lib::Decidim::ParticipatorySpaceResourceableDecorator.decorate
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# frozen_string_literal: true

if Decidim::DepartmentAdmin.conferences_defined?
module Decidim
module Conferences
class ParticipatorySpacePermissions < Decidim::DepartmentAdmin::Permissions
def initialize(*)
module Decidim
module Conferences
parent_class = Decidim::DepartmentAdmin.conferences_defined? ? Decidim::DepartmentAdmin::Permissions : Object
class ParticipatorySpacePermissions < parent_class
def initialize(*)
if Decidim::DepartmentAdmin.conferences_defined?
# This are the same permissions as Decidim's conferences space.
# Right now are the same for admin and public views
self.class.delegate_chain = [Decidim::Conferences::Permissions]
super
end
super
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/decidim/department_admin/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Decidim
module DepartmentAdmin
# see CHANGELOG.md
def self.version
"0.7.0"
"0.7.1"
end
end
end
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 602ccc3

Please sign in to comment.