Skip to content

Commit

Permalink
fix multiple vote
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed May 25, 2024
1 parent 124741e commit a628322
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webmock (3.23.0)
webmock (3.23.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

module SomEnergia
module Consultations
module QuestionMultipleVotesControllerOverride
extend ActiveSupport::Concern

included do
# rubocop:disable Rails/LexicallyScopedActionFilter
before_action :transform_params, only: :create
# rubocop:enable Rails/LexicallyScopedActionFilter

private

def transform_params
params["responses"] = params["responses"].values.flatten if params["responses"].respond_to? :values
end
end
end
end
end
1 change: 1 addition & 0 deletions config/initializers/decidim_overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
Decidim::Consultations::Admin::UpdateResponse.include(SomEnergia::Consultations::Admin::UpdateResponseOverride)
Decidim::Consultations::Admin::QuestionConfigurationForm.include(SomEnergia::Consultations::Admin::QuestionConfigurationFormOverride)
Decidim::Consultations::Admin::ResponseForm.include(SomEnergia::Consultations::Admin::ResponseFormOverride)
Decidim::Consultations::QuestionMultipleVotesController.include(SomEnergia::Consultations::QuestionMultipleVotesControllerOverride)

Decidim::ParticipatoryProcesses::ProcessFiltersCell.include(SomEnergia::ProcessFiltersCellOverride)

Expand Down

0 comments on commit a628322

Please sign in to comment.