Add and apply rules for multi-line arrays
We were already applying these rules in most cases. Note we aren't enabling the `MultilineArrayLineBreaks` rule because we've got places with many elements whire it isn't clear whether having one element per line would make the code more readable.
This commit is contained in:
@@ -60,13 +60,14 @@ class Admin::BudgetsController < Admin::BaseController
|
||||
|
||||
def allowed_params
|
||||
descriptions = Budget::Phase::PHASE_KINDS.map { |p| "description_#{p}" }.map(&:to_sym)
|
||||
valid_attributes = [:phase,
|
||||
:currency_symbol,
|
||||
:voting_style,
|
||||
:hide_money,
|
||||
administrator_ids: [],
|
||||
valuator_ids: [],
|
||||
image_attributes: image_attributes
|
||||
valid_attributes = [
|
||||
:phase,
|
||||
:currency_symbol,
|
||||
:voting_style,
|
||||
:hide_money,
|
||||
administrator_ids: [],
|
||||
valuator_ids: [],
|
||||
image_attributes: image_attributes
|
||||
] + descriptions
|
||||
|
||||
[*valid_attributes, *report_attributes, translation_params(Budget)]
|
||||
|
||||
@@ -77,12 +77,12 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
|
||||
investment_headings = Budget::Heading.where(id: investments.pluck(:heading_id)).sort_by(&:name)
|
||||
|
||||
all_headings_filter = [
|
||||
{
|
||||
name: t("valuation.budget_investments.index.headings_filter_all"),
|
||||
id: nil,
|
||||
count: investments.size
|
||||
}
|
||||
]
|
||||
{
|
||||
name: t("valuation.budget_investments.index.headings_filter_all"),
|
||||
id: nil,
|
||||
count: investments.size
|
||||
}
|
||||
]
|
||||
|
||||
investment_headings.reduce(all_headings_filter) do |filters, heading|
|
||||
filters << {
|
||||
|
||||
Reference in New Issue
Block a user