Make budget headings translatable
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
class Admin::BudgetHeadingsController < Admin::BaseController
|
||||
include Translatable
|
||||
include FeatureFlags
|
||||
feature_flag :budgets
|
||||
|
||||
@@ -62,8 +63,8 @@ class Admin::BudgetHeadingsController < Admin::BaseController
|
||||
end
|
||||
|
||||
def budget_heading_params
|
||||
params.require(:budget_heading).permit(:name, :price, :population, :allow_custom_content,
|
||||
:latitude, :longitude)
|
||||
valid_attributes = [:price, :population, :allow_custom_content, :latitude, :longitude]
|
||||
params.require(:budget_heading).permit(*valid_attributes, translation_params(Budget::Heading))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -75,8 +75,8 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
|
||||
def heading_filters
|
||||
investments = @budget.investments.by_valuator(current_user.valuator.try(:id))
|
||||
.visible_to_valuators.distinct
|
||||
|
||||
investment_headings = Budget::Heading.where(id: investments.pluck(:heading_id).uniq)
|
||||
investment_headings = Budget::Heading.joins(:translations)
|
||||
.where(id: investments.pluck(:heading_id).uniq)
|
||||
.order(name: :asc)
|
||||
|
||||
all_headings_filter = [
|
||||
|
||||
Reference in New Issue
Block a user