diff --git a/.rubocop.yml b/.rubocop.yml index 45c299599..31cdfe4d2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -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 diff --git a/app/controllers/legislation/annotations_controller.rb b/app/controllers/legislation/annotations_controller.rb index 1d26211c2..a09d18928 100644 --- a/app/controllers/legislation/annotations_controller.rb +++ b/app/controllers/legislation/annotations_controller.rb @@ -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 diff --git a/app/controllers/legislation/answers_controller.rb b/app/controllers/legislation/answers_controller.rb index 7da980e15..586769a1f 100644 --- a/app/controllers/legislation/answers_controller.rb +++ b/app/controllers/legislation/answers_controller.rb @@ -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 diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 545b379b4..ae0cb1276 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -92,7 +92,7 @@ <% if user_signed_in? && !comments_closed_for_commentable?(comment.commentable) && !require_verified_resident_for_commentable?(comment.commentable, current_user) %>  |  <%= 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 } %> diff --git a/spec/system/admin/poll/questions/answers/images/images_spec.rb b/spec/system/admin/poll/questions/answers/images/images_spec.rb index b54396477..398680c2c 100644 --- a/spec/system/admin/poll/questions/answers/images/images_spec.rb +++ b/spec/system/admin/poll/questions/answers/images/images_spec.rb @@ -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", diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb index 9f3086b46..c07c0c1e4 100644 --- a/spec/system/budgets/investments_spec.rb +++ b/spec/system/budgets/investments_spec.rb @@ -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 diff --git a/spec/system/debates_spec.rb b/spec/system/debates_spec.rb index b6235ea17..2d0e2868f 100644 --- a/spec/system/debates_spec.rb +++ b/spec/system/debates_spec.rb @@ -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 diff --git a/spec/system/management/budget_investments_spec.rb b/spec/system/management/budget_investments_spec.rb index b814066e8..01efdc9b3 100644 --- a/spec/system/management/budget_investments_spec.rb +++ b/spec/system/management/budget_investments_spec.rb @@ -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 diff --git a/spec/system/proposals_spec.rb b/spec/system/proposals_spec.rb index 6a4c8437b..989caf158 100644 --- a/spec/system/proposals_spec.rb +++ b/spec/system/proposals_spec.rb @@ -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"