Skip to content

Commit

Permalink
Hotfix for current_assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagemaru committed Jan 9, 2025
1 parent d8bbb70 commit 8f1cbd1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion config/initializers/decidim_zuerich_customization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
# Override default for surveys
Decidim.find_component_manifest(:surveys).settings(:global).attributes[:clean_after_publish].default = false


module Decidim
module Map
module Provider
Expand All @@ -77,3 +76,15 @@ module DynamicMap
end
end

class Object
def current_assembly
@current_assembly ||= begin
model = organization_assemblies if defined?(organization_assemblies)
model ||= Decidim::Assembly

model.find_by!(
slug: params[:assembly_slug] || params[:slug]
)
end
end
end

0 comments on commit 8f1cbd1

Please sign in to comment.