Add and apply Lint/SymbolConversion rubocop rule

This rule was added in Rubocop 1.9.0.

We're excluding the Setting model in order to keep the settings
consistent.
This commit is contained in:
Javi Martín
2021-08-11 17:40:52 +02:00
parent 54cced9296
commit 41a9d17c76
9 changed files with 33 additions and 27 deletions

View File

@@ -187,6 +187,12 @@ Lint/SafeNavigationChain:
Lint/ShadowingOuterLocalVariable:
Enabled: true
Lint/SymbolConversion:
Enabled: true
Exclude:
- "app/models/setting.rb"
- "db/dev_seeds/settings.rb"
Lint/UselessAssignment:
Enabled: true

View File

@@ -99,9 +99,9 @@ class Legislation::AnnotationsController < Legislation::BaseController
end
def track_event
ahoy.track "legislation_annotation_created".to_sym,
"legislation_annotation_id": @annotation.id,
"legislation_draft_version_id": @draft_version.id
ahoy.track :legislation_annotation_created,
legislation_annotation_id: @annotation.id,
legislation_draft_version_id: @draft_version.id
end
def convert_ranges_parameters

View File

@@ -35,9 +35,9 @@ class Legislation::AnswersController < Legislation::BaseController
end
def track_event
ahoy.track "legislation_answer_created".to_sym,
"legislation_answer_id": @answer.id,
"legislation_question_option_id": @answer.legislation_question_option_id,
"legislation_question_id": @answer.legislation_question_id
ahoy.track :legislation_answer_created,
legislation_answer_id: @answer.id,
legislation_question_option_id: @answer.legislation_question_option_id,
legislation_question_id: @answer.legislation_question_id
end
end

View File

@@ -92,7 +92,7 @@
<% if user_signed_in? && !comments_closed_for_commentable?(comment.commentable) && !require_verified_resident_for_commentable?(comment.commentable, current_user) %>
<span class="divider">&nbsp;|&nbsp;</span>
<%= link_to(comment_link_text(comment), "",
class: "js-add-comment-link", data: { "id": dom_id(comment) }) %>
class: "js-add-comment-link", data: { id: dom_id(comment) }) %>
<% unless valuation %>
<%= render "comments/actions", { comment: comment } %>

View File

@@ -4,7 +4,7 @@ describe "Images", :admin do
it_behaves_like "nested imageable",
"poll_question_answer",
"new_admin_answer_image_path",
{ "answer_id": "id" },
{ answer_id: "id" },
nil,
"Save image",
"Image uploaded successfully",

View File

@@ -16,12 +16,12 @@ describe "Budget Investments" do
it_behaves_like "remotely_translatable",
:budget_investment,
"budget_investments_path",
{ "budget_id": "budget_id" }
{ budget_id: "budget_id" }
it_behaves_like "remotely_translatable",
:budget_investment,
"budget_investment_path",
{ "budget_id": "budget_id", "id": "id" }
{ budget_id: "budget_id", id: "id" }
it_behaves_like "flaggable", :budget_investment
end
@@ -1039,25 +1039,25 @@ describe "Budget Investments" do
expect(page).not_to have_content("Local government is not competent in this matter")
end
it_behaves_like "followable", "budget_investment", "budget_investment_path", { "budget_id": "budget_id", "id": "id" }
it_behaves_like "followable", "budget_investment", "budget_investment_path", { budget_id: "budget_id", id: "id" }
it_behaves_like "imageable", "budget_investment", "budget_investment_path", { "budget_id": "budget_id", "id": "id" }
it_behaves_like "imageable", "budget_investment", "budget_investment_path", { budget_id: "budget_id", id: "id" }
it_behaves_like "nested imageable",
"budget_investment",
"new_budget_investment_path",
{ "budget_id": "budget_id" },
{ budget_id: "budget_id" },
"imageable_fill_new_valid_budget_investment",
"Create Investment",
"Budget Investment created successfully."
it_behaves_like "documentable", "budget_investment", "budget_investment_path", { "budget_id": "budget_id", "id": "id" }
it_behaves_like "documentable", "budget_investment", "budget_investment_path", { budget_id: "budget_id", id: "id" }
it_behaves_like "nested documentable",
"user",
"budget_investment",
"new_budget_investment_path",
{ "budget_id": "budget_id" },
{ budget_id: "budget_id" },
"documentable_fill_new_valid_budget_investment",
"Create Investment",
"Budget Investment created successfully."
@@ -1068,7 +1068,7 @@ describe "Budget Investments" do
"new_budget_investment_path",
"",
"budget_investment_path",
{ "budget_id": "budget_id" }
{ budget_id: "budget_id" }
context "Destroy" do
scenario "Admin cannot destroy budget investments", :admin do

View File

@@ -11,7 +11,7 @@ describe "Debates" do
it_behaves_like "remotely_translatable",
:debate,
"debate_path",
{ "id": "id" }
{ id: "id" }
it_behaves_like "flaggable", :debate
end

View File

@@ -11,7 +11,7 @@ describe "Budget Investments" do
"user",
"budget_investment",
"new_management_budget_investment_path",
{ "budget_id": "budget_id" },
{ budget_id: "budget_id" },
"documentable_fill_new_valid_budget_investment",
"Create Investment",
"Investment created successfully.",
@@ -20,7 +20,7 @@ describe "Budget Investments" do
it_behaves_like "nested imageable",
"budget_investment",
"new_management_budget_investment_path",
{ "budget_id": "budget_id" },
{ budget_id: "budget_id" },
"imageable_fill_new_valid_budget_investment",
"Create Investment",
"Investment created successfully.",
@@ -32,7 +32,7 @@ describe "Budget Investments" do
"new_management_budget_investment_path",
"",
"management_budget_investment_path",
{ "budget_id": "budget_id" },
{ budget_id: "budget_id" },
management: true
context "Load" do

View File

@@ -13,7 +13,7 @@ describe "Proposals" do
it_behaves_like "remotely_translatable",
:proposal,
"proposal_path",
{ "id": "id" }
{ id: "id" }
it_behaves_like "flaggable", :proposal
end
@@ -1257,9 +1257,9 @@ describe "Proposals" do
expect(page).not_to have_content "This proposal has been flagged as inappropriate by several users."
end
it_behaves_like "followable", "proposal", "proposal_path", { "id": "id" }
it_behaves_like "followable", "proposal", "proposal_path", { id: "id" }
it_behaves_like "imageable", "proposal", "proposal_path", { "id": "id" }
it_behaves_like "imageable", "proposal", "proposal_path", { id: "id" }
it_behaves_like "nested imageable",
"proposal",
@@ -1272,12 +1272,12 @@ describe "Proposals" do
it_behaves_like "nested imageable",
"proposal",
"edit_proposal_path",
{ "id": "id" },
{ id: "id" },
nil,
"Save changes",
"Proposal updated successfully"
it_behaves_like "documentable", "proposal", "proposal_path", { "id": "id" }
it_behaves_like "documentable", "proposal", "proposal_path", { id: "id" }
it_behaves_like "nested documentable",
"user",
@@ -1292,7 +1292,7 @@ describe "Proposals" do
"user",
"proposal",
"edit_proposal_path",
{ "id": "id" },
{ id: "id" },
nil,
"Save changes",
"Proposal updated successfully"