diff --git a/CHANGELOG.md b/CHANGELOG.md index d13ac2a..19282f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index a883dde..cdbc41c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) diff --git a/app/decorators/lib/decidim/participatory_space_resourceable_decorator.rb b/app/decorators/lib/decidim/participatory_space_resourceable_decorator.rb index b769c70..6137bd7 100644 --- a/app/decorators/lib/decidim/participatory_space_resourceable_decorator.rb +++ b/app/decorators/lib/decidim/participatory_space_resourceable_decorator.rb @@ -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` @@ -30,4 +30,4 @@ def user_role_config_for(user, role_name) end end -::Decidim::ParticipatorySpaceResourceableDecorator.decorate +::Lib::Decidim::ParticipatorySpaceResourceableDecorator.decorate diff --git a/app/permissions/decidim/conferences/participatory_space_permissions.rb b/app/permissions/decidim/conferences/participatory_space_permissions.rb index 8cd4ac0..eae2b37 100644 --- a/app/permissions/decidim/conferences/participatory_space_permissions.rb +++ b/app/permissions/decidim/conferences/participatory_space_permissions.rb @@ -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 diff --git a/lib/decidim/department_admin/version.rb b/lib/decidim/department_admin/version.rb index 995a0a3..e18b851 100644 --- a/lib/decidim/department_admin/version.rb +++ b/lib/decidim/department_admin/version.rb @@ -5,7 +5,7 @@ module Decidim module DepartmentAdmin # see CHANGELOG.md def self.version - "0.7.0" + "0.7.1" end end end diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2295821 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "decidim-department_admin", + "lockfileVersion": 2, + "requires": true, + "packages": {} +}