Update polls translatable fields

The `:name` attribute is still allowed in the controller because some
forks use it when creating a poll from a budget.
This commit is contained in:
Javi Martín
2018-10-10 14:37:43 +02:00
committed by decabeza
parent 601fe666d9
commit 6478bb70c2
5 changed files with 29 additions and 17 deletions

View File

@@ -61,10 +61,10 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController
def poll_params
image_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]
attributes = [:name, :starts_at, :ends_at, :geozone_restricted, :summary, :description,
:results_enabled, :stats_enabled, geozone_ids: [],
attributes = [:name, :starts_at, :ends_at, :geozone_restricted, :results_enabled,
:stats_enabled, geozone_ids: [],
image_attributes: image_attributes]
params.require(:poll).permit(*attributes, *translation_params(Poll))
params.require(:poll).permit(*attributes, translation_params(Poll))
end
def search_params