Use double quotes in controllers/
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class Valuation::BaseController < ApplicationController
|
||||
layout 'admin'
|
||||
layout "admin"
|
||||
|
||||
before_action :authenticate_user!
|
||||
before_action :verify_valuator
|
||||
|
||||
@@ -33,7 +33,7 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
|
||||
end
|
||||
|
||||
Activity.log(current_user, :valuate, @investment)
|
||||
notice = t('valuation.budget_investments.notice.valuate')
|
||||
notice = t("valuation.budget_investments.notice.valuate")
|
||||
redirect_to valuation_budget_budget_investment_path(@budget, @investment), notice: notice
|
||||
else
|
||||
render action: :edit
|
||||
@@ -61,7 +61,7 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
|
||||
end
|
||||
|
||||
def resource_name
|
||||
resource_model.parameterize('_')
|
||||
resource_model.parameterize("_")
|
||||
end
|
||||
|
||||
def load_budget
|
||||
@@ -81,7 +81,7 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
|
||||
|
||||
all_headings_filter = [
|
||||
{
|
||||
name: t('valuation.budget_investments.index.headings_filter_all'),
|
||||
name: t("valuation.budget_investments.index.headings_filter_all"),
|
||||
id: nil,
|
||||
count: investments.size
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
|
||||
|
||||
def restrict_access
|
||||
unless current_user.administrator? || current_budget.valuating?
|
||||
raise CanCan::AccessDenied.new(I18n.t('valuation.budget_investments.not_in_valuating_phase'))
|
||||
raise CanCan::AccessDenied.new(I18n.t("valuation.budget_investments.not_in_valuating_phase"))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -117,16 +117,16 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController
|
||||
return if current_user.administrator? ||
|
||||
Budget::ValuatorAssignment.exists?(investment_id: params[:id],
|
||||
valuator_id: current_user.valuator.id)
|
||||
raise ActionController::RoutingError.new('Not Found')
|
||||
raise ActionController::RoutingError.new("Not Found")
|
||||
end
|
||||
|
||||
def valid_price_params?
|
||||
if /\D/.match params[:budget_investment][:price]
|
||||
@investment.errors.add(:price, I18n.t('budgets.investments.wrong_price_format'))
|
||||
@investment.errors.add(:price, I18n.t("budgets.investments.wrong_price_format"))
|
||||
end
|
||||
|
||||
if /\D/.match params[:budget_investment][:price_first_year]
|
||||
@investment.errors.add(:price_first_year, I18n.t('budgets.investments.wrong_price_format'))
|
||||
@investment.errors.add(:price_first_year, I18n.t("budgets.investments.wrong_price_format"))
|
||||
end
|
||||
|
||||
@investment.errors.empty?
|
||||
|
||||
@@ -26,7 +26,7 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
|
||||
@spending_proposal.send_unfeasible_email
|
||||
end
|
||||
|
||||
redirect_to valuation_spending_proposal_path(@spending_proposal), notice: t('valuation.spending_proposals.notice.valuate')
|
||||
redirect_to valuation_spending_proposal_path(@spending_proposal), notice: t("valuation.spending_proposals.notice.valuate")
|
||||
else
|
||||
render action: :edit
|
||||
end
|
||||
@@ -37,12 +37,12 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
|
||||
def geozone_filters
|
||||
spending_proposals = SpendingProposal.by_valuator(current_user.valuator.try(:id)).valuation_open.all.to_a
|
||||
|
||||
[ { name: t('valuation.spending_proposals.index.geozone_filter_all'),
|
||||
[ { name: t("valuation.spending_proposals.index.geozone_filter_all"),
|
||||
id: nil,
|
||||
pending_count: spending_proposals.size
|
||||
},
|
||||
{ name: t('geozones.none'),
|
||||
id: 'all',
|
||||
{ name: t("geozones.none"),
|
||||
id: "all",
|
||||
pending_count: spending_proposals.count{|x| x.geozone_id.nil?}
|
||||
}
|
||||
] + Geozone.all.order(name: :asc).collect do |g|
|
||||
@@ -54,7 +54,7 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
|
||||
end
|
||||
|
||||
def valuation_params
|
||||
params[:spending_proposal][:feasible] = nil if params[:spending_proposal][:feasible] == 'nil'
|
||||
params[:spending_proposal][:feasible] = nil if params[:spending_proposal][:feasible] == "nil"
|
||||
|
||||
params.require(:spending_proposal).permit(:price, :price_first_year, :price_explanation, :feasible, :feasible_explanation,
|
||||
:time_scope, :valuation_finished, :internal_comments)
|
||||
@@ -67,16 +67,16 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
|
||||
def restrict_access_to_assigned_items
|
||||
return if current_user.administrator? ||
|
||||
ValuationAssignment.exists?(spending_proposal_id: params[:id], valuator_id: current_user.valuator.id)
|
||||
raise ActionController::RoutingError.new('Not Found')
|
||||
raise ActionController::RoutingError.new("Not Found")
|
||||
end
|
||||
|
||||
def valid_price_params?
|
||||
if /\D/.match params[:spending_proposal][:price]
|
||||
@spending_proposal.errors.add(:price, I18n.t('spending_proposals.wrong_price_format'))
|
||||
@spending_proposal.errors.add(:price, I18n.t("spending_proposals.wrong_price_format"))
|
||||
end
|
||||
|
||||
if /\D/.match params[:spending_proposal][:price_first_year]
|
||||
@spending_proposal.errors.add(:price_first_year, I18n.t('spending_proposals.wrong_price_format'))
|
||||
@spending_proposal.errors.add(:price_first_year, I18n.t("spending_proposals.wrong_price_format"))
|
||||
end
|
||||
|
||||
@spending_proposal.errors.empty?
|
||||
|
||||
Reference in New Issue
Block a user