Update milestones translatable fields

Note the title field was hidden since commit 01b9aa8, even though it was
required and translatable. I've removed the required validation rule,
since it doesn't seem to make much sense and made the translatable
tests harder to write.

Also note the method `I18n.localize`, which is used to set the
milestone's title, uses `I18n.locale` even if it's inside a
`Globalize.with_locale` block, and so the same format is generated for
every locale.
This commit is contained in:
Javi Martín
2018-10-09 00:08:02 +02:00
parent a326bcb0a1
commit 01a254545f
5 changed files with 16 additions and 14 deletions

View File

@@ -46,8 +46,8 @@ class Admin::BudgetInvestmentMilestonesController < Admin::BaseController
def milestone_params
image_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]
documents_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]
attributes = [:title, :description, :publication_date, :budget_investment_id, :status_id,
*translation_params(Budget::Investment::Milestone),
attributes = [:publication_date, :budget_investment_id, :status_id,
translation_params(Budget::Investment::Milestone),
image_attributes: image_attributes, documents_attributes: documents_attributes]
params.require(:budget_investment_milestone).permit(*attributes)