From 09c63e354cd905d2ebf82b687561215314297791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 1 Jul 2023 14:53:02 +0200 Subject: [PATCH 01/13] Add and apply Layout/DotPosition rule Since IRB has improved its support for multiline, the main argument towars using a trailing dot no longer affects most people. It still affects me, though, since I use Pry :), but I agree leading dots are more readable, so I'm enabling the rule anyway. --- .rubocop.yml | 3 ++ .../poll/officer_assignments_controller.rb | 18 ++++++------ .../admin/poll/recounts_controller.rb | 8 +++--- .../officing/ballot_sheets_controller.rb | 14 +++++----- .../officing/results_controller.rb | 28 +++++++++---------- .../admin_budget_investments_helper.rb | 4 +-- app/models/budget/investment.rb | 8 +++--- app/models/poll/officer.rb | 16 +++++------ app/models/tag_cloud.rb | 10 +++---- .../verification/management/managed_user.rb | 4 +-- .../annotations/_comments.html.erb | 4 +-- spec/lib/remote_translations/caller_spec.rb | 4 +-- spec/shared/system/remotely_translatable.rb | 4 +-- spec/support/common_actions.rb | 8 +++--- .../management/document_verifications_spec.rb | 8 +++--- 15 files changed, 72 insertions(+), 69 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 8bd439eae..3d1c997bf 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -21,6 +21,9 @@ Bundler/OrderedGems: Layout/AssignmentIndentation: Enabled: true +Layout/DotPosition: + Enabled: true + Layout/EmptyLineAfterGuardClause: Enabled: true diff --git a/app/controllers/admin/poll/officer_assignments_controller.rb b/app/controllers/admin/poll/officer_assignments_controller.rb index 8b3d21e0c..008918c3f 100644 --- a/app/controllers/admin/poll/officer_assignments_controller.rb +++ b/app/controllers/admin/poll/officer_assignments_controller.rb @@ -4,10 +4,10 @@ class Admin::Poll::OfficerAssignmentsController < Admin::Poll::BaseController before_action :load_booth_assignment, only: [:create] def index - @officers = ::Poll::Officer. - includes(:user). - order("users.username"). - where( + @officers = ::Poll::Officer + .includes(:user) + .order("users.username") + .where( id: @poll.officer_assignments.select(:officer_id).distinct.map(&:officer_id) ).page(params[:page]).per(50) end @@ -15,11 +15,11 @@ class Admin::Poll::OfficerAssignmentsController < Admin::Poll::BaseController def by_officer @poll = ::Poll.includes(:booths).find(params[:poll_id]) @officer = ::Poll::Officer.includes(:user).find(officer_assignment_params[:officer_id]) - @officer_assignments = ::Poll::OfficerAssignment. - joins(:booth_assignment). - includes(:recounts, booth_assignment: :booth). - by_officer_and_poll(@officer.id, @poll.id). - order(:date) + @officer_assignments = ::Poll::OfficerAssignment + .joins(:booth_assignment) + .includes(:recounts, booth_assignment: :booth) + .by_officer_and_poll(@officer.id, @poll.id) + .order(:date) end def search_officers diff --git a/app/controllers/admin/poll/recounts_controller.rb b/app/controllers/admin/poll/recounts_controller.rb index 7e1756894..04dbc53e5 100644 --- a/app/controllers/admin/poll/recounts_controller.rb +++ b/app/controllers/admin/poll/recounts_controller.rb @@ -4,10 +4,10 @@ class Admin::Poll::RecountsController < Admin::Poll::BaseController def index @stats = Poll::Stats.new(@poll) - @booth_assignments = @poll.booth_assignments. - includes(:booth, :recounts, :voters). - order("poll_booths.name"). - page(params[:page]).per(50) + @booth_assignments = @poll.booth_assignments + .includes(:booth, :recounts, :voters) + .order("poll_booths.name") + .page(params[:page]).per(50) end private diff --git a/app/controllers/officing/ballot_sheets_controller.rb b/app/controllers/officing/ballot_sheets_controller.rb index eb29971e6..fcface1e9 100644 --- a/app/controllers/officing/ballot_sheets_controller.rb +++ b/app/controllers/officing/ballot_sheets_controller.rb @@ -42,13 +42,13 @@ class Officing::BallotSheetsController < Officing::BaseController end def load_officer_assignments - @officer_assignments = ::Poll::OfficerAssignment. - includes(booth_assignment: [:booth]). - joins(:booth_assignment). - final. - where(id: current_user.poll_officer.officer_assignment_ids). - where(poll_booth_assignments: { poll_id: @poll.id }). - where(date: Date.current) + @officer_assignments = ::Poll::OfficerAssignment + .includes(booth_assignment: [:booth]) + .joins(:booth_assignment) + .final + .where(id: current_user.poll_officer.officer_assignment_ids) + .where(poll_booth_assignments: { poll_id: @poll.id }) + .where(date: Date.current) end def load_officer_assignment diff --git a/app/controllers/officing/results_controller.rb b/app/controllers/officing/results_controller.rb index 6dbfe96ab..795122400 100644 --- a/app/controllers/officing/results_controller.rb +++ b/app/controllers/officing/results_controller.rb @@ -21,12 +21,12 @@ class Officing::ResultsController < Officing::BaseController def index @booth_assignment = ::Poll::BoothAssignment.includes(:booth).find(index_params[:booth_assignment_id]) - if current_user.poll_officer.officer_assignments.final. - where(booth_assignment_id: @booth_assignment.id).exists? + if current_user.poll_officer.officer_assignments.final + .where(booth_assignment_id: @booth_assignment.id).exists? - @partial_results = ::Poll::PartialResult.includes(:question). - where(booth_assignment_id: index_params[:booth_assignment_id]). - where(date: index_params[:date]) + @partial_results = ::Poll::PartialResult.includes(:question) + .where(booth_assignment_id: index_params[:booth_assignment_id]) + .where(date: index_params[:date]) @recounts = ::Poll::Recount.where(booth_assignment_id: @booth_assignment.id, date: index_params[:date]) end end @@ -89,18 +89,18 @@ class Officing::ResultsController < Officing::BaseController end def load_officer_assignment - @officer_assignment = current_user.poll_officer. - officer_assignments.final.find_by(id: results_params[:officer_assignment_id]) + @officer_assignment = current_user.poll_officer + .officer_assignments.final.find_by(id: results_params[:officer_assignment_id]) end def load_officer_assignments - @officer_assignments = ::Poll::OfficerAssignment. - includes(booth_assignment: [:booth]). - joins(:booth_assignment). - final. - where(id: current_user.poll_officer.officer_assignment_ids). - where(poll_booth_assignments: { poll_id: @poll.id }). - where(date: Date.current) + @officer_assignments = ::Poll::OfficerAssignment + .includes(booth_assignment: [:booth]) + .joins(:booth_assignment) + .final + .where(id: current_user.poll_officer.officer_assignment_ids) + .where(poll_booth_assignments: { poll_id: @poll.id }) + .where(date: Date.current) end def load_partial_results diff --git a/app/helpers/admin_budget_investments_helper.rb b/app/helpers/admin_budget_investments_helper.rb index f34fbcb65..9efa16e69 100644 --- a/app/helpers/admin_budget_investments_helper.rb +++ b/app/helpers/admin_budget_investments_helper.rb @@ -22,8 +22,8 @@ module AdminBudgetInvestmentsHelper end def valuator_select_options(budget) - budget.valuators.order("description ASC").order("users.email ASC").includes(:user). - map { |v| [v.description_or_email, "valuator_#{v.id}"] } + budget.valuators.order("description ASC").order("users.email ASC").includes(:user) + .map { |v| [v.description_or_email, "valuator_#{v.id}"] } end def valuator_group_select_options diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 051c569bb..7381ab78e 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -109,8 +109,8 @@ class Budget end def self.by_valuator_group(valuator_group_id) - joins(:valuator_group_assignments). - where(budget_valuator_group_assignments: { valuator_group_id: valuator_group_id }) + joins(:valuator_group_assignments) + .where(budget_valuator_group_assignments: { valuator_group_id: valuator_group_id }) end before_validation :set_responsible_name @@ -198,8 +198,8 @@ class Budget def self.search_by_title_or_id(title_or_id) with_joins = with_translations(Globalize.fallbacks(I18n.locale)) - with_joins.where(id: title_or_id). - or(with_joins.where("budget_investment_translations.title ILIKE ?", "%#{title_or_id}%")) + with_joins.where(id: title_or_id) + .or(with_joins.where("budget_investment_translations.title ILIKE ?", "%#{title_or_id}%")) end def searchable_values diff --git a/app/models/poll/officer.rb b/app/models/poll/officer.rb index 0b8d56dc1..f43eb8d04 100644 --- a/app/models/poll/officer.rb +++ b/app/models/poll/officer.rb @@ -16,17 +16,17 @@ class Poll end def voting_days_assigned_polls - officer_assignments.voting_days.includes(booth_assignment: :poll). - map(&:booth_assignment). - map(&:poll).uniq.compact. - sort { |x, y| y.ends_at <=> x.ends_at } + officer_assignments.voting_days.includes(booth_assignment: :poll) + .map(&:booth_assignment) + .map(&:poll).uniq.compact + .sort { |x, y| y.ends_at <=> x.ends_at } end def final_days_assigned_polls - officer_assignments.final.includes(booth_assignment: :poll). - map(&:booth_assignment). - map(&:poll).uniq.compact. - sort { |x, y| y.ends_at <=> x.ends_at } + officer_assignments.final.includes(booth_assignment: :poll) + .map(&:booth_assignment) + .map(&:poll).uniq.compact + .sort { |x, y| y.ends_at <=> x.ends_at } end def todays_booths diff --git a/app/models/tag_cloud.rb b/app/models/tag_cloud.rb index 0ab981653..c891e3f5d 100644 --- a/app/models/tag_cloud.rb +++ b/app/models/tag_cloud.rb @@ -7,11 +7,11 @@ class TagCloud end def tags - resource_model_scoped. - last_week.send(counts). - where("lower(name) NOT IN (?)", category_names + geozone_names + default_blacklist). - order("#{table_name}_count": :desc, name: :asc). - limit(10) + resource_model_scoped + .last_week.send(counts) + .where("lower(name) NOT IN (?)", category_names + geozone_names + default_blacklist) + .order("#{table_name}_count": :desc, name: :asc) + .limit(10) end def counts diff --git a/app/models/verification/management/managed_user.rb b/app/models/verification/management/managed_user.rb index babf18f58..cbf5d29e3 100644 --- a/app/models/verification/management/managed_user.rb +++ b/app/models/verification/management/managed_user.rb @@ -2,8 +2,8 @@ class Verification::Management::ManagedUser include ActiveModel::Model def self.find(document_type, document_number) - User.where.not(document_number: nil). - find_or_initialize_by(document_type: document_type, + User.where.not(document_number: nil) + .find_or_initialize_by(document_type: document_type, document_number: document_number) end end diff --git a/app/views/legislation/annotations/_comments.html.erb b/app/views/legislation/annotations/_comments.html.erb index ea746bac0..33375f40a 100644 --- a/app/views/legislation/annotations/_comments.html.erb +++ b/app/views/legislation/annotations/_comments.html.erb @@ -1,5 +1,5 @@ -<% annotation.comments.roots.sort_by_most_voted. - limit(Legislation::Annotation::COMMENTS_PAGE_SIZE).each do |comment| %> +<% annotation.comments.roots.sort_by_most_voted + .limit(Legislation::Annotation::COMMENTS_PAGE_SIZE).each do |comment| %>

<%= truncate comment.body, length: 250 %>

diff --git a/spec/lib/remote_translations/caller_spec.rb b/spec/lib/remote_translations/caller_spec.rb index b24307cb9..8551096ef 100644 --- a/spec/lib/remote_translations/caller_spec.rb +++ b/spec/lib/remote_translations/caller_spec.rb @@ -220,8 +220,8 @@ describe RemoteTranslations::Caller, :remote_translations do locale = remote_translation.locale fake_response = ["translated title", "translated description", "translated summary", nil] - expect_any_instance_of(client).to receive(:call).with(field_values_sanitized, locale). - and_return(fake_response) + expect_any_instance_of(client).to receive(:call).with(field_values_sanitized, locale) + .and_return(fake_response) caller.call end diff --git a/spec/shared/system/remotely_translatable.rb b/spec/shared/system/remotely_translatable.rb index 1204b8f64..21e0c661e 100644 --- a/spec/shared/system/remotely_translatable.rb +++ b/spec/shared/system/remotely_translatable.rb @@ -10,8 +10,8 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume before do Setting["feature.remote_translations"] = true available_locales_response = %w[de en es fr pt zh-Hans] - expect(RemoteTranslations::Microsoft::AvailableLocales).to receive(:available_locales).at_most(4).times. - and_return(available_locales_response) + expect(RemoteTranslations::Microsoft::AvailableLocales).to receive(:available_locales).at_most(4).times + .and_return(available_locales_response) allow(Rails.application.secrets).to receive(:microsoft_api_key).and_return("123") end diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 51da757f9..95c3c4e47 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -35,8 +35,8 @@ module CommonActions end def validate_officer - allow_any_instance_of(Officing::BaseController). - to receive(:verify_officer_assignment).and_return(true) + allow_any_instance_of(Officing::BaseController) + .to receive(:verify_officer_assignment).and_return(true) end def fill_in_proposal @@ -69,8 +69,8 @@ module CommonActions def set_officing_booth(booth = nil) booth = create(:poll_booth) if booth.blank? - allow_any_instance_of(Officing::BaseController). - to receive(:current_booth).and_return(booth) + allow_any_instance_of(Officing::BaseController) + .to receive(:current_booth).and_return(booth) end def click_sdg_goal(code) diff --git a/spec/system/management/document_verifications_spec.rb b/spec/system/management/document_verifications_spec.rb index 30cb8de69..efb72664b 100644 --- a/spec/system/management/document_verifications_spec.rb +++ b/spec/system/management/document_verifications_spec.rb @@ -32,8 +32,8 @@ describe "DocumentVerifications" do describe "Verifying througth Census" do context "Census API" do scenario "Verifying a user which does not exist and is not in the census shows an error" do - expect_any_instance_of(Verification::Management::Document).to receive(:in_census?). - and_return(false) + expect_any_instance_of(Verification::Management::Document).to receive(:in_census?) + .and_return(false) login_as_manager visit management_document_verifications_path @@ -55,8 +55,8 @@ describe "DocumentVerifications" do context "Remote Census API", :remote_census do scenario "Verifying a user which does not exist and is not in the census shows an error" do - expect_any_instance_of(Verification::Management::Document).to receive(:in_census?). - and_return(false) + expect_any_instance_of(Verification::Management::Document).to receive(:in_census?) + .and_return(false) login_as_manager visit management_document_verifications_path From 1cb6268d4eb7286c57752fbd90b0b24a49f506c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 1 Jul 2023 15:00:50 +0200 Subject: [PATCH 02/13] Add and apply Layout/ClosingHeredocIndentation rule --- .rubocop.yml | 3 +++ spec/factories/legislations.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 3d1c997bf..a5ad75143 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -21,6 +21,9 @@ Bundler/OrderedGems: Layout/AssignmentIndentation: Enabled: true +Layout/ClosingHeredocIndentation: + Enabled: true + Layout/DotPosition: Enabled: true diff --git a/spec/factories/legislations.rb b/spec/factories/legislations.rb index 3c1dbe41b..4ae250317 100644 --- a/spec/factories/legislations.rb +++ b/spec/factories/legislations.rb @@ -134,7 +134,7 @@ FactoryBot.define do |----|---------|-----|--------| | 1 | Roberta | 39 | M | | 2 | Oliver | 25 | F | - BODY_MARKDOWN + BODY_MARKDOWN end end From 97aca0cf955b00746e5c266c24ff3236c60d938c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 1 Jul 2023 16:05:32 +0200 Subject: [PATCH 03/13] 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. --- .rubocop.yml | 10 ++++++++++ .../shared/advanced_search_component.rb | 17 ++++++++++------- app/controllers/admin/budgets_controller.rb | 15 ++++++++------- .../valuation/budget_investments_controller.rb | 12 ++++++------ app/models/budget/phase.rb | 2 +- app/models/comment.rb | 4 ++-- app/models/concerns/statisticable.rb | 3 +-- config/application.rb | 3 ++- spec/lib/tasks/seed_spec.rb | 4 ++-- spec/models/local_census_records/import_spec.rb | 2 +- 10 files changed, 43 insertions(+), 29 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index a5ad75143..2442210e7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -18,6 +18,9 @@ Bundler/OrderedGems: Enabled: true ConsiderPunctuation: true +Layout/ArrayAlignment: + Enabled: true + Layout/AssignmentIndentation: Enabled: true @@ -57,6 +60,10 @@ Layout/EndOfLine: Layout/ExtraSpacing: Enabled: true +Layout/FirstArrayElementIndentation: + Enabled: true + EnforcedStyle: consistent + Layout/HeredocIndentation: Enabled: true @@ -79,6 +86,9 @@ Layout/LineLength: Max: 110 Severity: refactor +Layout/MultilineArrayBraceLayout: + Enabled: true + Layout/MultilineBlockLayout: Enabled: true diff --git a/app/components/shared/advanced_search_component.rb b/app/components/shared/advanced_search_component.rb index 242335ed7..43a72917e 100644 --- a/app/components/shared/advanced_search_component.rb +++ b/app/components/shared/advanced_search_component.rb @@ -8,13 +8,16 @@ class Shared::AdvancedSearchComponent < ApplicationComponent end def date_range_options - options_for_select([ - [t("shared.advanced_search.date_1"), 1], - [t("shared.advanced_search.date_2"), 2], - [t("shared.advanced_search.date_3"), 3], - [t("shared.advanced_search.date_4"), 4], - [t("shared.advanced_search.date_5"), "custom"]], - selected_date_range) + options_for_select( + [ + [t("shared.advanced_search.date_1"), 1], + [t("shared.advanced_search.date_2"), 2], + [t("shared.advanced_search.date_3"), 3], + [t("shared.advanced_search.date_4"), 4], + [t("shared.advanced_search.date_5"), "custom"] + ], + selected_date_range + ) end def selected_date_range diff --git a/app/controllers/admin/budgets_controller.rb b/app/controllers/admin/budgets_controller.rb index 9617c904a..6ce7b2721 100644 --- a/app/controllers/admin/budgets_controller.rb +++ b/app/controllers/admin/budgets_controller.rb @@ -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)] diff --git a/app/controllers/valuation/budget_investments_controller.rb b/app/controllers/valuation/budget_investments_controller.rb index 3460b6d20..185606ff1 100644 --- a/app/controllers/valuation/budget_investments_controller.rb +++ b/app/controllers/valuation/budget_investments_controller.rb @@ -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 << { diff --git a/app/models/budget/phase.rb b/app/models/budget/phase.rb index 28ae761d1..5e4b00fca 100644 --- a/app/models/budget/phase.rb +++ b/app/models/budget/phase.rb @@ -1,7 +1,7 @@ class Budget class Phase < ApplicationRecord PHASE_KINDS = %w[informing accepting reviewing selecting valuating publishing_prices balloting - reviewing_ballots finished].freeze + reviewing_ballots finished].freeze PUBLISHED_PRICES_PHASES = %w[publishing_prices balloting reviewing_ballots finished].freeze DESCRIPTION_MAX_LENGTH = 2000 diff --git a/app/models/comment.rb b/app/models/comment.rb index e1a348bfa..a3304e34e 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -6,8 +6,8 @@ class Comment < ApplicationRecord include Searchable COMMENTABLE_TYPES = %w[Debate Proposal Budget::Investment Poll Topic - Legislation::Question Legislation::Annotation - Legislation::Proposal].freeze + Legislation::Question Legislation::Annotation + Legislation::Proposal].freeze acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases diff --git a/app/models/concerns/statisticable.rb b/app/models/concerns/statisticable.rb index 790b01b3e..9b32b22b3 100644 --- a/app/models/concerns/statisticable.rb +++ b/app/models/concerns/statisticable.rb @@ -163,8 +163,7 @@ module Statisticable [75, 79], [80, 84], [85, 89], - [90, 300] - ] + [90, 300]] end def participants_between_ages(from, to) diff --git a/config/application.rb b/config/application.rb index 9391b39fa..268880a5c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -97,7 +97,8 @@ module Consul "uk-UA", "val", "zh-CN", - "zh-TW"] + "zh-TW" + ] config.i18n.available_locales = available_locales config.i18n.fallbacks = [I18n.default_locale, { "ca" => "es", diff --git a/spec/lib/tasks/seed_spec.rb b/spec/lib/tasks/seed_spec.rb index c7cad5ff0..c3e16b75d 100644 --- a/spec/lib/tasks/seed_spec.rb +++ b/spec/lib/tasks/seed_spec.rb @@ -5,8 +5,8 @@ describe "rake db:seed" do default_locales = I18n.available_locales begin I18n.available_locales = [:ar, :bg, :bs, :ca, :cs, :da, :de, :el, :en, :es, :"es-PE", :eu, :fa, :fr, - :gl, :he, :hr, :id, :it, :ka, :nl, :oc, :pl, :"pt-BR", - :ro, :ru, :sl, :sq, :so, :sr, :sv, :tr, :val, :"zh-CN", :"zh-TW"] + :gl, :he, :hr, :id, :it, :ka, :nl, :oc, :pl, :"pt-BR", + :ro, :ru, :sl, :sq, :so, :sr, :sv, :tr, :val, :"zh-CN", :"zh-TW"] SiteCustomization::Page.destroy_all load Rails.root.join("db", "pages.rb") diff --git a/spec/models/local_census_records/import_spec.rb b/spec/models/local_census_records/import_spec.rb index 7a97f0df5..b763c13c7 100644 --- a/spec/models/local_census_records/import_spec.rb +++ b/spec/models/local_census_records/import_spec.rb @@ -72,7 +72,7 @@ describe LocalCensusRecords::Import do invalid_records_document_types = [nil, "1", "2", "3", "DNI"] invalid_records_document_numbers = ["44556678T", nil, "22556678T", "X11556678", "Z11556678"] invalid_records_date_of_births = [Date.parse("07/08/1984"), Date.parse("07/08/1985"), nil, - Date.parse("07/08/1987"), Date.parse("07/08/1987")] + Date.parse("07/08/1987"), Date.parse("07/08/1987")] invalid_records_postal_codes = ["7008", "7009", "7010", nil, "7011"] expect(import.invalid_records.map(&:document_type)) .to eq(invalid_records_document_types) From 8b13daad95743f990adeeb9fc454ba725cadb32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 1 Jul 2023 16:17:33 +0200 Subject: [PATCH 04/13] Add and apply rules for multi-line hashes For the HashAlignment rule, we're using the default `key` style (keys are aligned and values aren't) instead of the `table` style (both keys and values are aligned) because, even if we used both in the application, we used the `key` style a lot more. Furthermore, the `table` style looks strange in places where there are both very long and very short keys and sometimes we weren't even consistent with the `table` style, aligning some keys without aligning other keys. Ideally we could align hashes to "either key or table", so developers can decide whether keeping the symmetry of the code is worth it in a case-per-case basis, but Rubocop doesn't allow this option. --- .rubocop.yml | 13 ++ .../admin/budgets/actions_component.rb | 4 +- .../admin/geozones/form_component.html.erb | 2 +- .../form_field_component.html.erb | 2 +- .../investments/form_component.html.erb | 16 +-- .../investments/votes_component.html.erb | 2 +- .../debates/form_component.html.erb | 8 +- app/components/documents/nested_component.rb | 4 +- app/components/images/nested_component.rb | 2 +- .../layout/footer_component.html.erb | 2 +- .../notification_item_component.html.erb | 5 +- .../proposals/form_component.html.erb | 16 +-- .../budgets_wizard/budgets_controller.rb | 6 +- .../content_blocks_controller.rb | 10 +- .../admin/system_emails_controller.rb | 18 +-- .../dashboard/actions_controller.rb | 5 +- .../dashboard/poster_controller.rb | 2 +- app/controllers/officing/voters_controller.rb | 2 +- .../budget_investments_controller.rb | 8 +- app/helpers/budgets_helper.rb | 6 +- app/helpers/legislation_helper.rb | 10 +- app/helpers/milestones_helper.rb | 2 +- app/helpers/translatable_form_helper.rb | 2 +- app/models/budget/heading.rb | 4 +- app/models/budget/investment.rb | 9 +- app/models/comment.rb | 10 +- app/models/concerns/relationable.rb | 4 +- app/models/debate.rb | 6 +- app/models/legislation/draft_version.rb | 4 +- app/models/legislation/process.rb | 20 +-- app/models/legislation/proposal.rb | 10 +- app/models/officing/residence.rb | 20 +-- app/models/poll.rb | 4 +- app/models/poll/ballot_sheet.rb | 6 +- app/models/poll/question.rb | 8 +- app/models/poll/shift.rb | 6 +- app/models/progress_bar.rb | 8 +- app/models/proposal.rb | 10 +- app/models/proposal_notification.rb | 2 +- app/models/sdg/local_target.rb | 2 +- app/models/setting.rb | 16 +-- app/models/user.rb | 46 +++---- .../verification/management/managed_user.rb | 4 +- app/models/verification/residence.rb | 10 +- .../admin/dashboard/actions/_form.html.erb | 15 ++- .../legislation/draft_versions/_form.html.erb | 12 +- .../legislation/proposals/_form.html.erb | 10 +- .../admin/poll/active_polls/_form.html.erb | 2 +- app/views/admin/signature_sheets/new.html.erb | 2 +- .../site_customization/pages/_form.html.erb | 5 +- .../_proposal_notification_digest.html.erb | 2 +- app/views/comments/_comment.html.erb | 4 +- app/views/dashboard/mailer/forward.html.erb | 2 +- ...actions_notification_on_published.html.erb | 2 +- app/views/dashboard/polls/_poll.html.erb | 5 +- app/views/devise/passwords/edit.html.erb | 7 +- app/views/devise/unlocks/new.html.erb | 2 +- app/views/documents/_document.html.erb | 6 +- .../legislation/processes/_process.html.erb | 2 +- .../legislation/proposals/_form.html.erb | 10 +- .../email_verifications/new.html.erb | 5 +- .../management/user_invites/new.html.erb | 2 +- app/views/notifications/index.html.erb | 3 +- app/views/officing/voters/_can_vote.html.erb | 8 +- .../organizations/registrations/new.html.erb | 2 +- app/views/polls/show.html.erb | 2 +- app/views/topics/show.html.erb | 3 +- .../users/registrations/delete_form.html.erb | 4 +- app/views/users/registrations/new.html.erb | 2 +- .../_valuation_comments.html.erb | 4 +- config/application.rb | 14 +- config/routes/devise.rb | 20 +-- db/dev_seeds/banners.rb | 2 +- db/dev_seeds/milestones.rb | 2 +- db/dev_seeds/polls.rb | 10 +- db/dev_seeds/sdg.rb | 2 +- db/dev_seeds/users.rb | 67 ++++++---- ...4152_add_time_zone_to_default_datetimes.rb | 4 +- lib/census_api.rb | 10 +- lib/markdown_converter.rb | 16 +-- lib/omniauth_wordpress.rb | 8 +- lib/sms_api.rb | 2 +- .../related_list_component_spec.rb | 4 +- .../shared/banner_component_spec.rb | 4 +- .../answers/videos_controller_spec.rb | 12 +- spec/controllers/comments_controller_spec.rb | 16 +-- .../annotations_controller_spec.rb | 122 +++++++++--------- .../legislation/answers_controller_spec.rb | 14 +- .../management/sessions_controller_spec.rb | 8 +- spec/lib/remote_census_api_spec.rb | 6 +- spec/lib/tasks/seed_spec.rb | 6 +- spec/models/budget/ballot/line_spec.rb | 2 +- spec/models/budget/heading_spec.rb | 2 +- spec/models/budget/phase_spec.rb | 12 +- spec/models/budget/stats_spec.rb | 2 +- spec/models/legislation/process/phase_spec.rb | 2 +- spec/models/legislation/process_spec.rb | 2 +- spec/models/local_census_record_spec.rb | 2 +- spec/models/machine_learning_spec.rb | 36 ++++-- spec/models/officing/residence_spec.rb | 18 +-- spec/models/poll/ballot_sheet_spec.rb | 4 +- spec/models/poll/poll_spec.rb | 35 +++-- spec/models/poll/stats_spec.rb | 8 +- spec/models/proposal_notification_spec.rb | 4 +- spec/models/proposal_spec.rb | 4 +- spec/models/site_customization/image_spec.rb | 2 +- .../verification/management/document_spec.rb | 8 +- spec/models/verification/residence_spec.rb | 12 +- spec/shared/models/notifiable.rb | 2 +- spec/shared/system/admin_progressable.rb | 6 +- spec/system/admin/activity_spec.rb | 4 +- spec/system/admin/banners_spec.rb | 68 +++++----- spec/system/admin/budget_investments_spec.rb | 57 ++++---- spec/system/admin/budgets_spec.rb | 5 +- .../information_texts_spec.rb | 4 +- spec/system/admin/system_emails_spec.rb | 8 +- spec/system/admin/verifications_spec.rb | 4 +- spec/system/banners_spec.rb | 2 +- spec/system/budgets/budgets_spec.rb | 20 +-- spec/system/budgets/investments_spec.rb | 6 +- spec/system/dashboard/dashboard_spec.rb | 16 ++- .../system/legislation/draft_versions_spec.rb | 6 +- spec/system/legislation/processes_spec.rb | 4 +- spec/system/legislation/summary_spec.rb | 16 +-- spec/system/machine_learning_spec.rb | 8 +- spec/system/tags/budget_investments_spec.rb | 2 +- .../valuation/budget_investments_spec.rb | 9 +- spec/system/verification/email_spec.rb | 16 +-- spec/system/verification/letter_spec.rb | 14 +- .../level_three_verification_spec.rb | 8 +- 130 files changed, 676 insertions(+), 592 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 2442210e7..3dd4dad6d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -64,6 +64,13 @@ Layout/FirstArrayElementIndentation: Enabled: true EnforcedStyle: consistent +Layout/FirstHashElementIndentation: + Enabled: true + EnforcedStyle: consistent + +Layout/HashAlignment: + Enabled: true + Layout/HeredocIndentation: Enabled: true @@ -92,6 +99,12 @@ Layout/MultilineArrayBraceLayout: Layout/MultilineBlockLayout: Enabled: true +Layout/MultilineHashBraceLayout: + Enabled: true + +Layout/MultilineHashKeyLineBreaks: + Enabled: true + Layout/SpaceAfterColon: Enabled: true diff --git a/app/components/admin/budgets/actions_component.rb b/app/components/admin/budgets/actions_component.rb index 0ac54df74..6637a1c5f 100644 --- a/app/components/admin/budgets/actions_component.rb +++ b/app/components/admin/budgets/actions_component.rb @@ -83,10 +83,10 @@ class Admin::Budgets::ActionsComponent < ApplicationComponent balloting_phase = budget.phases.find_by(kind: "balloting") admin_polls_path(poll: { - name: budget.name, + name: budget.name, budget_id: budget.id, starts_at: balloting_phase.starts_at, - ends_at: balloting_phase.ends_at + ends_at: balloting_phase.ends_at }) end diff --git a/app/components/admin/geozones/form_component.html.erb b/app/components/admin/geozones/form_component.html.erb index 7d55ecf00..bd6a00ab9 100644 --- a/app/components/admin/geozones/form_component.html.erb +++ b/app/components/admin/geozones/form_component.html.erb @@ -41,6 +41,6 @@
<%= f.submit(value: t("admin.geozones.edit.form.submit_button"), - class: "button success") %> + class: "button success") %>
<% end %> diff --git a/app/components/admin/site_customization/information_texts/form_field_component.html.erb b/app/components/admin/site_customization/information_texts/form_field_component.html.erb index dc0e18a3f..2bda944d7 100644 --- a/app/components/admin/site_customization/information_texts/form_field_component.html.erb +++ b/app/components/admin/site_customization/information_texts/form_field_component.html.erb @@ -5,5 +5,5 @@ rows: 5, class: "js-globalize-attribute", style: site_customization_display_translation_style(locale), - data: { locale: locale } %> + data: { locale: locale } %> <% end %> diff --git a/app/components/budgets/investments/form_component.html.erb b/app/components/budgets/investments/form_component.html.erb index 20b15c201..0b52328f3 100644 --- a/app/components/budgets/investments/form_component.html.erb +++ b/app/components/budgets/investments/form_component.html.erb @@ -51,10 +51,10 @@ <% if feature?(:map) %>
<%= render "map_locations/form_fields", - form: f, + form: f, map_location: investment.map_location || MapLocation.new, - label: t("budgets.investments.form.map_location"), - help: t("budgets.investments.form.map_location_instructions"), + label: t("budgets.investments.form.map_location"), + help: t("budgets.investments.form.map_location_instructions"), i18n_namespace: "budgets.investments" %>
<% end %> @@ -80,11 +80,11 @@
<%= f.text_field :tag_list, value: investment.tag_list.to_s, - label: false, - placeholder: t("budgets.investments.form.tags_placeholder"), - aria: { describedby: "tags-list-help-text" }, - class: "js-tag-list tag-autocomplete", - data: { js_url: suggest_tags_path } %> + label: false, + placeholder: t("budgets.investments.form.tags_placeholder"), + aria: { describedby: "tags-list-help-text" }, + class: "js-tag-list tag-autocomplete", + data: { js_url: suggest_tags_path } %>
<%= render SDG::RelatedListSelectorComponent.new(f) %> diff --git a/app/components/budgets/investments/votes_component.html.erb b/app/components/budgets/investments/votes_component.html.erb index 0ce045d3d..89612f4b6 100644 --- a/app/components/budgets/investments/votes_component.html.erb +++ b/app/components/budgets/investments/votes_component.html.erb @@ -27,7 +27,7 @@ title: t("budgets.investments.investment.support_title"), method: "post", remote: !display_support_alert?, - data: ({ confirm: confirm_vote_message } if display_support_alert?), + data: ({ confirm: confirm_vote_message } if display_support_alert?), "aria-label": support_aria_label %> <% end %> <% end %> diff --git a/app/components/debates/form_component.html.erb b/app/components/debates/form_component.html.erb index f7d1b2098..42aa1d38f 100644 --- a/app/components/debates/form_component.html.erb +++ b/app/components/debates/form_component.html.erb @@ -29,10 +29,10 @@
<%= f.text_field :tag_list, value: debate.tag_list.to_s, - hint: t("debates.form.tags_instructions"), - placeholder: t("debates.form.tags_placeholder"), - data: { js_url: suggest_tags_path }, - class: "tag-autocomplete" %> + hint: t("debates.form.tags_instructions"), + placeholder: t("debates.form.tags_placeholder"), + data: { js_url: suggest_tags_path }, + class: "tag-autocomplete" %>
<%= render SDG::RelatedListSelectorComponent.new(f) %> diff --git a/app/components/documents/nested_component.rb b/app/components/documents/nested_component.rb index 2b4f6f909..f3adb214b 100644 --- a/app/components/documents/nested_component.rb +++ b/app/components/documents/nested_component.rb @@ -17,8 +17,8 @@ class Documents::NestedComponent < ApplicationComponent def note t "documents.form.note", max_documents_allowed: max_documents_allowed, - accepted_content_types: Document.humanized_accepted_content_types, - max_file_size: documentable.class.max_file_size + accepted_content_types: Document.humanized_accepted_content_types, + max_file_size: documentable.class.max_file_size end def max_documents_allowed? diff --git a/app/components/images/nested_component.rb b/app/components/images/nested_component.rb index 768f4d880..448e8d810 100644 --- a/app/components/images/nested_component.rb +++ b/app/components/images/nested_component.rb @@ -14,6 +14,6 @@ class Images::NestedComponent < ApplicationComponent def note t "images.form.note", accepted_content_types: Image.humanized_accepted_content_types, - max_file_size: Image.max_file_size + max_file_size: Image.max_file_size end end diff --git a/app/components/layout/footer_component.html.erb b/app/components/layout/footer_component.html.erb index 8b63dbab5..1dea274fc 100644 --- a/app/components/layout/footer_component.html.erb +++ b/app/components/layout/footer_component.html.erb @@ -8,7 +8,7 @@

<%= sanitize(t("layouts.footer.description", open_source: link_to(t("layouts.footer.open_source"), t("layouts.footer.open_source_url"), target: "blank", rel: "nofollow"), - consul: link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), target: "blank", rel: "nofollow"))) %> + consul: link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), target: "blank", rel: "nofollow"))) %>

diff --git a/app/components/layout/notification_item_component.html.erb b/app/components/layout/notification_item_component.html.erb index 363c2fd2d..8be3090d3 100644 --- a/app/components/layout/notification_item_component.html.erb +++ b/app/components/layout/notification_item_component.html.erb @@ -1,7 +1,8 @@ <% if user %>
  • - <%= link_to notifications_path, rel: "nofollow", title: text, - class: "notifications #{notifications_class}" do %> + <%= link_to notifications_path, rel: "nofollow", + title: text, + class: "notifications #{notifications_class}" do %> <%= t("layouts.header.notification_item.notifications") %> diff --git a/app/components/proposals/form_component.html.erb b/app/components/proposals/form_component.html.erb index 658ca2f90..727606511 100644 --- a/app/components/proposals/form_component.html.erb +++ b/app/components/proposals/form_component.html.erb @@ -59,10 +59,10 @@ <% if feature?(:map) %>
    <%= render "map_locations/form_fields", - form: f, + form: f, map_location: proposal.map_location || MapLocation.new, - label: t("proposals.form.map_location"), - help: t("proposals.form.map_location_instructions"), + label: t("proposals.form.map_location"), + help: t("proposals.form.map_location_instructions"), i18n_namespace: "proposals" %>
    <% end %> @@ -80,11 +80,11 @@
    <%= f.text_field :tag_list, value: proposal.tag_list.to_s, - label: false, - placeholder: t("proposals.form.tags_placeholder"), - class: "js-tag-list tag-autocomplete", - aria: { describedby: "tag-list-help-text" }, - data: { js_url: suggest_tags_path } %> + label: false, + placeholder: t("proposals.form.tags_placeholder"), + class: "js-tag-list tag-autocomplete", + aria: { describedby: "tag-list-help-text" }, + data: { js_url: suggest_tags_path } %> <% if current_user.unverified? %> diff --git a/app/controllers/admin/budgets_wizard/budgets_controller.rb b/app/controllers/admin/budgets_wizard/budgets_controller.rb index 51952f78f..84b92f890 100644 --- a/app/controllers/admin/budgets_wizard/budgets_controller.rb +++ b/app/controllers/admin/budgets_wizard/budgets_controller.rb @@ -37,8 +37,10 @@ class Admin::BudgetsWizard::BudgetsController < Admin::BudgetsWizard::BaseContro end def allowed_params - valid_attributes = [:currency_symbol, :voting_style, :hide_money, administrator_ids: [], - valuator_ids: [], image_attributes: image_attributes] + valid_attributes = [:currency_symbol, :voting_style, :hide_money, + administrator_ids: [], + valuator_ids: [], + image_attributes: image_attributes] [*valid_attributes, translation_params(Budget)] end diff --git a/app/controllers/admin/site_customization/content_blocks_controller.rb b/app/controllers/admin/site_customization/content_blocks_controller.rb index 585711f59..d553c1446 100644 --- a/app/controllers/admin/site_customization/content_blocks_controller.rb +++ b/app/controllers/admin/site_customization/content_blocks_controller.rb @@ -1,10 +1,10 @@ class Admin::SiteCustomization::ContentBlocksController < Admin::SiteCustomization::BaseController load_and_authorize_resource :content_block, class: "SiteCustomization::ContentBlock", - except: [ - :delete_heading_content_block, - :edit_heading_content_block, - :update_heading_content_block - ] + except: [ + :delete_heading_content_block, + :edit_heading_content_block, + :update_heading_content_block + ] def index @content_blocks = SiteCustomization::ContentBlock.order(:name, :locale) diff --git a/app/controllers/admin/system_emails_controller.rb b/app/controllers/admin/system_emails_controller.rb index b112ac414..502e735bb 100644 --- a/app/controllers/admin/system_emails_controller.rb +++ b/app/controllers/admin/system_emails_controller.rb @@ -4,17 +4,17 @@ class Admin::SystemEmailsController < Admin::BaseController def index @system_emails = { proposal_notification_digest: %w[view preview_pending], - budget_investment_created: %w[view edit_info], - budget_investment_selected: %w[view edit_info], + budget_investment_created: %w[view edit_info], + budget_investment_selected: %w[view edit_info], budget_investment_unfeasible: %w[view edit_info], budget_investment_unselected: %w[view edit_info], - comment: %w[view edit_info], - reply: %w[view edit_info], - direct_message_for_receiver: %w[view edit_info], - direct_message_for_sender: %w[view edit_info], - email_verification: %w[view edit_info], - user_invite: %w[view edit_info], - evaluation_comment: %w[view edit_info] + comment: %w[view edit_info], + reply: %w[view edit_info], + direct_message_for_receiver: %w[view edit_info], + direct_message_for_sender: %w[view edit_info], + email_verification: %w[view edit_info], + user_invite: %w[view edit_info], + evaluation_comment: %w[view edit_info] } end diff --git a/app/controllers/dashboard/actions_controller.rb b/app/controllers/dashboard/actions_controller.rb index 0a0b0d907..1de3f91d5 100644 --- a/app/controllers/dashboard/actions_controller.rb +++ b/app/controllers/dashboard/actions_controller.rb @@ -30,8 +30,9 @@ class Dashboard::ActionsController < Dashboard::BaseController def execute authorize! :dashboard, proposal - Dashboard::ExecutedAction.create(proposal: proposal, action: dashboard_action, - executed_at: Time.current) + Dashboard::ExecutedAction.create(proposal: proposal, + action: dashboard_action, + executed_at: Time.current) redirect_to request.referer end diff --git a/app/controllers/dashboard/poster_controller.rb b/app/controllers/dashboard/poster_controller.rb index 6c796973f..0d3955da6 100644 --- a/app/controllers/dashboard/poster_controller.rb +++ b/app/controllers/dashboard/poster_controller.rb @@ -10,7 +10,7 @@ class Dashboard::PosterController < Dashboard::BaseController dpi: 300, zoom: 0.32, show_as_html: Rails.env.test? || params.key?("debug"), - margin: { top: 0 } + margin: { top: 0 } end end end diff --git a/app/controllers/officing/voters_controller.rb b/app/controllers/officing/voters_controller.rb index bd7e4cd24..26b1a7f53 100644 --- a/app/controllers/officing/voters_controller.rb +++ b/app/controllers/officing/voters_controller.rb @@ -13,7 +13,7 @@ class Officing::VotersController < Officing::BaseController def create @poll = Poll.find(voter_params[:poll_id]) @user = User.find(voter_params[:user_id]) - @voter = Poll::Voter.new(document_type: @user.document_type, + @voter = Poll::Voter.new(document_type: @user.document_type, document_number: @user.document_number, user: @user, poll: @poll, diff --git a/app/controllers/valuation/budget_investments_controller.rb b/app/controllers/valuation/budget_investments_controller.rb index 185606ff1..3adee9d37 100644 --- a/app/controllers/valuation/budget_investments_controller.rb +++ b/app/controllers/valuation/budget_investments_controller.rb @@ -86,10 +86,10 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController investment_headings.reduce(all_headings_filter) do |filters, heading| filters << { - name: heading.name, - id: heading.id, - count: investments.count { |i| i.heading_id == heading.id } - } + name: heading.name, + id: heading.id, + count: investments.count { |i| i.heading_id == heading.id } + } end end diff --git a/app/helpers/budgets_helper.rb b/app/helpers/budgets_helper.rb index 0352570ed..ffcfc548c 100644 --- a/app/helpers/budgets_helper.rb +++ b/app/helpers/budgets_helper.rb @@ -33,13 +33,13 @@ module BudgetsHelper def budget_subnav_items_for(budget) { - results: t("budgets.results.link"), - stats: t("stats.budgets.link"), + results: t("budgets.results.link"), + stats: t("stats.budgets.link"), executions: t("budgets.executions.link") }.select { |section, _| can?(:"read_#{section}", budget) }.map do |section, text| { text: text, - url: send("budget_#{section}_path", budget), + url: send("budget_#{section}_path", budget), active: controller_name == section.to_s } end diff --git a/app/helpers/legislation_helper.rb b/app/helpers/legislation_helper.rb index dcc968a72..a62111397 100644 --- a/app/helpers/legislation_helper.rb +++ b/app/helpers/legislation_helper.rb @@ -9,12 +9,12 @@ module LegislationHelper def legislation_process_tabs(process) { - "info" => edit_admin_legislation_process_path(process), - "homepage" => edit_admin_legislation_process_homepage_path(process), - "questions" => admin_legislation_process_questions_path(process), - "proposals" => admin_legislation_process_proposals_path(process), + "info" => edit_admin_legislation_process_path(process), + "homepage" => edit_admin_legislation_process_homepage_path(process), + "questions" => admin_legislation_process_questions_path(process), + "proposals" => admin_legislation_process_proposals_path(process), "draft_versions" => admin_legislation_process_draft_versions_path(process), - "milestones" => admin_legislation_process_milestones_path(process) + "milestones" => admin_legislation_process_milestones_path(process) } end diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb index 888955e4e..e98ea3b1f 100644 --- a/app/helpers/milestones_helper.rb +++ b/app/helpers/milestones_helper.rb @@ -3,7 +3,7 @@ module MilestonesHelper text = number_to_percentage(progress_bar.percentage, precision: 0) tag.div class: "progress", - role: "progressbar", + role: "progressbar", "aria-valuenow": progress_bar.percentage, "aria-valuetext": "#{progress_bar.percentage}%", "aria-valuemax": ProgressBar::RANGE.max, diff --git a/app/helpers/translatable_form_helper.rb b/app/helpers/translatable_form_helper.rb index 6e73433c9..1ca593e1d 100644 --- a/app/helpers/translatable_form_helper.rb +++ b/app/helpers/translatable_form_helper.rb @@ -70,7 +70,7 @@ module TranslatableFormHelper { class: "translatable-fields js-globalize-attribute #{highlight_translation_html_class}", style: @template.display_translation_style(resource.globalized_model, locale), - data: { locale: locale } + data: { locale: locale } } end diff --git a/app/models/budget/heading.rb b/app/models/budget/heading.rb index 7b8fbde57..40cd75580 100644 --- a/app/models/budget/heading.rb +++ b/app/models/budget/heading.rb @@ -33,9 +33,9 @@ class Budget validates :slug, presence: true, format: /\A[a-z0-9\-_]+\z/ validates :population, numericality: { greater_than: 0 }, allow_nil: true validates :latitude, length: { maximum: 22 }, allow_blank: true, \ - format: /\A(-|\+)?([1-8]?\d(?:\.\d{1,})?|90(?:\.0{1,6})?)\z/ + format: /\A(-|\+)?([1-8]?\d(?:\.\d{1,})?|90(?:\.0{1,6})?)\z/ validates :longitude, length: { maximum: 22 }, allow_blank: true, \ - format: /\A(-|\+)?((?:1[0-7]|[1-9])?\d(?:\.\d{1,})?|180(?:\.0{1,})?)\z/ + format: /\A(-|\+)?((?:1[0-7]|[1-9])?\d(?:\.\d{1,})?|180(?:\.0{1,})?)\z/ validates :max_ballot_lines, numericality: { greater_than_or_equal_to: 1 } delegate :budget, :budget_id, to: :group, allow_nil: true diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 7381ab78e..f19335baa 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -51,7 +51,7 @@ class Budget has_many :comments, -> { where(valuation: false) }, as: :commentable, inverse_of: :commentable has_one :summary_comment, as: :commentable, class_name: "MlSummaryComment", dependent: :destroy has_many :valuations, -> { where(valuation: true) }, - as: :commentable, + as: :commentable, inverse_of: :commentable, class_name: "Comment" @@ -203,8 +203,9 @@ class Budget end def searchable_values - { author.username => "B", - heading.name => "B", + { + author.username => "B", + heading.name => "B", tag_list.join(" ") => "B" }.merge(searchable_globalized_values) end @@ -394,7 +395,7 @@ class Budget end def searchable_translations_definitions - { title => "A", + { title => "A", description => "D" } end end diff --git a/app/models/comment.rb b/app/models/comment.rb index a3304e34e..762f1bdef 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -57,10 +57,10 @@ class Comment < ApplicationRecord def self.build(commentable, user, body, p_id = nil, valuation = false) new(commentable: commentable, - user_id: user.id, - body: body, - parent_id: p_id, - valuation: valuation) + user_id: user.id, + body: body, + parent_id: p_id, + valuation: valuation) end def self.find_commentable(c_type, c_id) @@ -134,7 +134,7 @@ class Comment < ApplicationRecord def searchable_values { - body => "A", + body => "A", commentable&.title => "B" } end diff --git a/app/models/concerns/relationable.rb b/app/models/concerns/relationable.rb index 6bbe678ca..ea73185d7 100644 --- a/app/models/concerns/relationable.rb +++ b/app/models/concerns/relationable.rb @@ -3,9 +3,9 @@ module Relationable included do has_many :related_contents, - as: :parent_relationable, + as: :parent_relationable, inverse_of: :parent_relationable, - dependent: :destroy + dependent: :destroy end def find_related_content(relationable) diff --git a/app/models/debate.rb b/app/models/debate.rb index 532144805..5333c08ad 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -57,15 +57,15 @@ class Debate < ApplicationRecord end def searchable_translations_definitions - { title => "A", + { title => "A", description => "D" } end def searchable_values { - author.username => "B", + author.username => "B", tag_list.join(" ") => "B", - geozone&.name => "B" + geozone&.name => "B" }.merge!(searchable_globalized_values) end diff --git a/app/models/legislation/draft_version.rb b/app/models/legislation/draft_version.rb index b36cb688a..a3a7f351a 100644 --- a/app/models/legislation/draft_version.rb +++ b/app/models/legislation/draft_version.rb @@ -12,8 +12,8 @@ class Legislation::DraftVersion < ApplicationRecord belongs_to :process, foreign_key: "legislation_process_id", inverse_of: :draft_versions has_many :annotations, foreign_key: "legislation_draft_version_id", - inverse_of: :draft_version, - dependent: :destroy + inverse_of: :draft_version, + dependent: :destroy validates_translation :title, presence: true validates_translation :body, presence: true diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index bd661338c..4e42b9a5d 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -28,20 +28,20 @@ class Legislation::Process < ApplicationRecord has_many :draft_versions, -> { order(:id) }, foreign_key: "legislation_process_id", - inverse_of: :process, - dependent: :destroy + inverse_of: :process, + dependent: :destroy has_one :final_draft_version, -> { where final_version: true, status: "published" }, - class_name: "Legislation::DraftVersion", + class_name: "Legislation::DraftVersion", foreign_key: "legislation_process_id", - inverse_of: :process + inverse_of: :process has_many :questions, -> { order(:id) }, foreign_key: "legislation_process_id", - inverse_of: :process, - dependent: :destroy + inverse_of: :process, + dependent: :destroy has_many :proposals, -> { order(:id) }, foreign_key: "legislation_process_id", - inverse_of: :process, - dependent: :destroy + inverse_of: :process, + dependent: :destroy validates_translation :title, presence: true validates :start_date, presence: true @@ -127,8 +127,8 @@ class Legislation::Process < ApplicationRecord def searchable_translations_definitions { - title => "A", - summary => "C", + title => "A", + summary => "C", description => "D" } end diff --git a/app/models/legislation/proposal.rb b/app/models/legislation/proposal.rb index 464bfd3fb..8a151e56b 100644 --- a/app/models/legislation/proposal.rb +++ b/app/models/legislation/proposal.rb @@ -57,12 +57,12 @@ class Legislation::Proposal < ApplicationRecord end def searchable_values - { title => "A", - author.username => "B", + { title => "A", + author.username => "B", tag_list.join(" ") => "B", - geozone&.name => "B", - summary => "C", - description => "D" } + geozone&.name => "B", + summary => "C", + description => "D" } end def self.search(terms) diff --git a/app/models/officing/residence.rb b/app/models/officing/residence.rb index 8d8f1fd57..711acb018 100644 --- a/app/models/officing/residence.rb +++ b/app/models/officing/residence.rb @@ -32,17 +32,17 @@ class Officing::Residence user.update!(verified_at: Time.current) else user_params = { - document_number: document_number, - document_type: document_type, - geozone: geozone, - date_of_birth: response_date_of_birth.in_time_zone.to_datetime, - gender: gender, + document_number: document_number, + document_type: document_type, + geozone: geozone, + date_of_birth: response_date_of_birth.in_time_zone.to_datetime, + gender: gender, residence_verified_at: Time.current, - verified_at: Time.current, - erased_at: Time.current, - password: random_password, - terms_of_service: "1", - email: nil + verified_at: Time.current, + erased_at: Time.current, + password: random_password, + terms_of_service: "1", + email: nil } self.user = User.create!(user_params) end diff --git a/app/models/poll.rb b/app/models/poll.rb index 18cba6d9b..8317ca3f0 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -205,8 +205,8 @@ class Poll < ApplicationRecord def searchable_translations_definitions { - name => "A", - summary => "C", + name => "A", + summary => "C", description => "D" } end diff --git a/app/models/poll/ballot_sheet.rb b/app/models/poll/ballot_sheet.rb index 62bf05726..1e2b65a39 100644 --- a/app/models/poll/ballot_sheet.rb +++ b/app/models/poll/ballot_sheet.rb @@ -36,8 +36,8 @@ class Poll::BallotSheet < ApplicationRecord def create_ballot(poll_ballot) Budget::Ballot.where(physical: true, - user: nil, - poll_ballot: poll_ballot, - budget: poll.budget).first_or_create! + user: nil, + poll_ballot: poll_ballot, + budget: poll.budget).first_or_create! end end diff --git a/app/models/poll/question.rb b/app/models/poll/question.rb index e513d3298..531972f4d 100644 --- a/app/models/poll/question.rb +++ b/app/models/poll/question.rb @@ -17,7 +17,7 @@ class Poll::Question < ApplicationRecord has_many :question_answers, -> { order "given_order asc" }, class_name: "Poll::Question::Answer", inverse_of: :question, - dependent: :destroy + dependent: :destroy has_many :partial_results belongs_to :proposal @@ -40,9 +40,9 @@ class Poll::Question < ApplicationRecord end def searchable_values - { title => "A", - proposal&.title => "A", - author.username => "C", + { title => "A", + proposal&.title => "A", + author.username => "C", author_visible_name => "C" } end diff --git a/app/models/poll/shift.rb b/app/models/poll/shift.rb index 080e6170c..452eb8b45 100644 --- a/app/models/poll/shift.rb +++ b/app/models/poll/shift.rb @@ -28,10 +28,10 @@ class Poll def create_officer_assignments booth.booth_assignments.order(:id).each do |booth_assignment| attrs = { - officer_id: officer_id, - date: date, + officer_id: officer_id, + date: date, booth_assignment_id: booth_assignment.id, - final: recount_scrutiny? + final: recount_scrutiny? } Poll::OfficerAssignment.create!(attrs) end diff --git a/app/models/progress_bar.rb b/app/models/progress_bar.rb index 700b9dc09..59d051da1 100644 --- a/app/models/progress_bar.rb +++ b/app/models/progress_bar.rb @@ -12,10 +12,10 @@ class ProgressBar < ApplicationRecord validates :progressable, presence: true validates :kind, presence: true, - uniqueness: { - scope: [:progressable_type, :progressable_id], - conditions: -> { primary } - } + uniqueness: { + scope: [:progressable_type, :progressable_id], + conditions: -> { primary } + } validates :percentage, presence: true, inclusion: { in: ->(*) { RANGE }}, numericality: { only_integer: true } validates_translation :title, presence: true, unless: :primary? diff --git a/app/models/proposal.rb b/app/models/proposal.rb index 92bcc2aa1..0382ad5e6 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -118,16 +118,16 @@ class Proposal < ApplicationRecord end def searchable_translations_definitions - { title => "A", - summary => "C", + { title => "A", + summary => "C", description => "D" } end def searchable_values { - author.username => "B", - tag_list.join(" ") => "B", - geozone&.name => "B" + author.username => "B", + tag_list.join(" ") => "B", + geozone&.name => "B" }.merge!(searchable_globalized_values) end diff --git a/app/models/proposal_notification.rb b/app/models/proposal_notification.rb index 8e24bca40..77ebde6f9 100644 --- a/app/models/proposal_notification.rb +++ b/app/models/proposal_notification.rb @@ -59,7 +59,7 @@ class ProposalNotification < ApplicationRecord def searchable_values { title => "A", - body => "B" + body => "B" } end diff --git a/app/models/sdg/local_target.rb b/app/models/sdg/local_target.rb index 2d593db8f..c5ee24650 100644 --- a/app/models/sdg/local_target.rb +++ b/app/models/sdg/local_target.rb @@ -9,7 +9,7 @@ class SDG::LocalTarget < ApplicationRecord validates_translation :description, presence: true validates :code, presence: true, uniqueness: true, - format: ->(local_target) { /\A#{local_target.target&.code}\.\d+/ } + format: ->(local_target) { /\A#{local_target.target&.code}\.\d+/ } validates :target, presence: true validates :goal, presence: true diff --git a/app/models/setting.rb b/app/models/setting.rb index a37e2a6d3..452daeb23 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -61,18 +61,18 @@ class Setting < ApplicationRecord def mime_types { "images" => { - "jpg" => "image/jpeg", - "png" => "image/png", - "gif" => "image/gif" + "jpg" => "image/jpeg", + "png" => "image/png", + "gif" => "image/gif" }, "documents" => { - "pdf" => "application/pdf", - "doc" => "application/msword", + "pdf" => "application/pdf", + "doc" => "application/msword", "docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - "xls" => "application/x-ole-storage", + "xls" => "application/x-ole-storage", "xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - "csv" => "text/plain", - "zip" => "application/zip" + "csv" => "text/plain", + "zip" => "application/zip" } } end diff --git a/app/models/user.rb b/app/models/user.rb index 6a400c5bc..2991a7842 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -26,55 +26,55 @@ class User < ApplicationRecord has_many :proposals, -> { with_hidden }, foreign_key: :author_id, inverse_of: :author has_many :activities has_many :budget_investments, -> { with_hidden }, - class_name: "Budget::Investment", + class_name: "Budget::Investment", foreign_key: :author_id, - inverse_of: :author + inverse_of: :author has_many :comments, -> { with_hidden }, inverse_of: :user has_many :failed_census_calls has_many :notifications has_many :direct_messages_sent, - class_name: "DirectMessage", + class_name: "DirectMessage", foreign_key: :sender_id, - inverse_of: :sender + inverse_of: :sender has_many :direct_messages_received, - class_name: "DirectMessage", + class_name: "DirectMessage", foreign_key: :receiver_id, - inverse_of: :receiver + inverse_of: :receiver has_many :legislation_answers, class_name: "Legislation::Answer", dependent: :destroy, inverse_of: :user has_many :follows has_many :legislation_annotations, - class_name: "Legislation::Annotation", + class_name: "Legislation::Annotation", foreign_key: :author_id, - inverse_of: :author + inverse_of: :author has_many :legislation_proposals, - class_name: "Legislation::Proposal", + class_name: "Legislation::Proposal", foreign_key: :author_id, - inverse_of: :author + inverse_of: :author has_many :legislation_questions, - class_name: "Legislation::Question", + class_name: "Legislation::Question", foreign_key: :author_id, - inverse_of: :author + inverse_of: :author has_many :polls, foreign_key: :author_id, inverse_of: :author has_many :poll_answers, - class_name: "Poll::Answer", + class_name: "Poll::Answer", foreign_key: :author_id, - inverse_of: :author + inverse_of: :author has_many :poll_pair_answers, - class_name: "Poll::PairAnswer", + class_name: "Poll::PairAnswer", foreign_key: :author_id, - inverse_of: :author + inverse_of: :author has_many :poll_partial_results, - class_name: "Poll::PartialResult", + class_name: "Poll::PartialResult", foreign_key: :author_id, - inverse_of: :author + inverse_of: :author has_many :poll_questions, - class_name: "Poll::Question", + class_name: "Poll::Question", foreign_key: :author_id, - inverse_of: :author + inverse_of: :author has_many :poll_recounts, - class_name: "Poll::Recount", + class_name: "Poll::Recount", foreign_key: :author_id, - inverse_of: :author + inverse_of: :author has_many :related_contents, foreign_key: :author_id, inverse_of: :author, dependent: nil has_many :topics, foreign_key: :author_id, inverse_of: :author belongs_to :geozone @@ -136,7 +136,7 @@ class User < ApplicationRecord oauth_user = User.find_by(email: oauth_email) if oauth_email_confirmed oauth_user || User.new( - username: auth.info.name || auth.uid, + username: auth.info.name || auth.uid, email: oauth_email, oauth_email: oauth_email, password: Devise.friendly_token[0, 20], diff --git a/app/models/verification/management/managed_user.rb b/app/models/verification/management/managed_user.rb index cbf5d29e3..e4a44e63d 100644 --- a/app/models/verification/management/managed_user.rb +++ b/app/models/verification/management/managed_user.rb @@ -3,7 +3,7 @@ class Verification::Management::ManagedUser def self.find(document_type, document_number) User.where.not(document_number: nil) - .find_or_initialize_by(document_type: document_type, - document_number: document_number) + .find_or_initialize_by(document_type: document_type, + document_number: document_number) end end diff --git a/app/models/verification/residence.rb b/app/models/verification/residence.rb index 539c3ef12..f266ed0db 100644 --- a/app/models/verification/residence.rb +++ b/app/models/verification/residence.rb @@ -29,11 +29,11 @@ class Verification::Residence user.take_votes_if_erased_document(document_number, document_type) - user.update(document_number: document_number, - document_type: document_type, - geozone: geozone, - date_of_birth: date_of_birth.in_time_zone.to_datetime, - gender: gender, + user.update(document_number: document_number, + document_type: document_type, + geozone: geozone, + date_of_birth: date_of_birth.in_time_zone.to_datetime, + gender: gender, residence_verified_at: Time.current) end diff --git a/app/views/admin/dashboard/actions/_form.html.erb b/app/views/admin/dashboard/actions/_form.html.erb index 178fe0596..151af1c54 100644 --- a/app/views/admin/dashboard/actions/_form.html.erb +++ b/app/views/admin/dashboard/actions/_form.html.erb @@ -44,18 +44,21 @@
    - <%= f.number_field :day_offset, step: 1, min: 0, - hint: t("admin.dashboard.actions.form.help_text") %> + <%= f.number_field :day_offset, step: 1, + min: 0, + hint: t("admin.dashboard.actions.form.help_text") %>
    - <%= f.number_field :required_supports, step: 1, min: 0, - hint: t("admin.dashboard.actions.form.help_text") %> + <%= f.number_field :required_supports, step: 1, + min: 0, + hint: t("admin.dashboard.actions.form.help_text") %>
    - <%= f.number_field :order, step: 1, min: 0, - hint: t("admin.dashboard.actions.form.help_text") %> + <%= f.number_field :order, step: 1, + min: 0, + hint: t("admin.dashboard.actions.form.help_text") %>
    diff --git a/app/views/admin/legislation/draft_versions/_form.html.erb b/app/views/admin/legislation/draft_versions/_form.html.erb index dd462837d..cb56e5ea2 100644 --- a/app/views/admin/legislation/draft_versions/_form.html.erb +++ b/app/views/admin/legislation/draft_versions/_form.html.erb @@ -1,8 +1,11 @@ <%= render "shared/globalize_locales", resource: @draft_version %> <%= translatable_form_for [:admin, @process, @draft_version], url: url, - html: { data: { markdown_changes_message: I18n.t("admin.legislation.draft_versions.edit.markdown_changes_message") }} do |f| %> - + html: { + data: { + markdown_changes_message: I18n.t("admin.legislation.draft_versions.edit.markdown_changes_message") + } + } do |f| %> <%= render "shared/errors", resource: @draft_version %>
    @@ -50,8 +53,9 @@
    - <%= translations_form.text_area :body, label: false, rows: 10, - class: "legislation-draft-version-body" %> + <%= translations_form.text_area :body, label: false, + rows: 10, + class: "legislation-draft-version-body" %>
    diff --git a/app/views/admin/legislation/proposals/_form.html.erb b/app/views/admin/legislation/proposals/_form.html.erb index 494d3fe14..fac27f829 100644 --- a/app/views/admin/legislation/proposals/_form.html.erb +++ b/app/views/admin/legislation/proposals/_form.html.erb @@ -4,11 +4,11 @@
    <%= f.text_field :custom_list, value: @process.tag_list_on(:customs).sort.join(", "), - label: t("admin.legislation.proposals.form.custom_categories"), - hint: t("admin.legislation.proposals.form.custom_categories_description"), - placeholder: t("admin.legislation.proposals.form.custom_categories_placeholder"), - class: "js-tag-list", - aria: { describedby: "tag-list-help-text" } %> + label: t("admin.legislation.proposals.form.custom_categories"), + hint: t("admin.legislation.proposals.form.custom_categories_description"), + placeholder: t("admin.legislation.proposals.form.custom_categories_placeholder"), + class: "js-tag-list", + aria: { describedby: "tag-list-help-text" } %>
    diff --git a/app/views/admin/poll/active_polls/_form.html.erb b/app/views/admin/poll/active_polls/_form.html.erb index 5794b641f..7e0af3329 100644 --- a/app/views/admin/poll/active_polls/_form.html.erb +++ b/app/views/admin/poll/active_polls/_form.html.erb @@ -9,7 +9,7 @@
    <%= t("admin.active_polls.form.description.help_text") %> <%= translations_form.text_area :description, class: "html-area", - maxlength: ActivePoll.description_max_length %> + maxlength: ActivePoll.description_max_length %>
    <% end %>
    diff --git a/app/views/admin/signature_sheets/new.html.erb b/app/views/admin/signature_sheets/new.html.erb index aa81aa5fd..5dd736d17 100644 --- a/app/views/admin/signature_sheets/new.html.erb +++ b/app/views/admin/signature_sheets/new.html.erb @@ -19,7 +19,7 @@
    <%= f.text_area :required_fields_to_verify, rows: "6", - hint: sanitize("#{required_fields_to_verify_text_help}
    #{example_text_help}") %> + hint: sanitize("#{required_fields_to_verify_text_help}
    #{example_text_help}") %> <%= f.submit(class: "button", value: t("admin.signature_sheets.new.submit")) %> <% end %> diff --git a/app/views/admin/site_customization/pages/_form.html.erb b/app/views/admin/site_customization/pages/_form.html.erb index a30395fc6..36e65c54e 100644 --- a/app/views/admin/site_customization/pages/_form.html.erb +++ b/app/views/admin/site_customization/pages/_form.html.erb @@ -21,8 +21,9 @@
    - <%= f.text_field :slug, size: 80, maxlength: 80, - hint: sanitize(t("admin.site_customization.pages.new.slug_help")) %> + <%= f.text_field :slug, size: 80, + maxlength: 80, + hint: sanitize(t("admin.site_customization.pages.new.slug_help")) %>
    diff --git a/app/views/admin/system_emails/preview_pending/_proposal_notification_digest.html.erb b/app/views/admin/system_emails/preview_pending/_proposal_notification_digest.html.erb index c0a80780f..2d86e0812 100644 --- a/app/views/admin/system_emails/preview_pending/_proposal_notification_digest.html.erb +++ b/app/views/admin/system_emails/preview_pending/_proposal_notification_digest.html.erb @@ -32,7 +32,7 @@ <%= link_to t("admin.system_emails.preview_pending.moderate_pending"), admin_system_email_moderate_pending_path(system_email_id: "proposal_notification_digest", - id: preview.id), + id: preview.id), method: :put, class: "button hollow float-right" %> diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 0ea042746..75d3887ca 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -100,8 +100,8 @@ <% if !valuation || can?(:comment_valuation, comment.commentable) %> <%= render "comments/form", { commentable: comment.commentable, - parent_id: comment.id, - valuation: valuation } %> + parent_id: comment.id, + valuation: valuation } %> <% end %> <% end %> diff --git a/app/views/dashboard/mailer/forward.html.erb b/app/views/dashboard/mailer/forward.html.erb index 95cea001c..d8ff79bc0 100644 --- a/app/views/dashboard/mailer/forward.html.erb +++ b/app/views/dashboard/mailer/forward.html.erb @@ -55,7 +55,7 @@ <%= link_to proposal_url(@proposal, anchor: "social-share") do %> <%= image_tag("social_buttons_mailer.png", alt: t("dashboard.mailer.forward.share_in"), - style: "max-width: 100%;") %> + style: "max-width: 100%;") %> <% end %> diff --git a/app/views/dashboard/mailer/new_actions_notification_on_published.html.erb b/app/views/dashboard/mailer/new_actions_notification_on_published.html.erb index e566ebd03..46d39c5ba 100644 --- a/app/views/dashboard/mailer/new_actions_notification_on_published.html.erb +++ b/app/views/dashboard/mailer/new_actions_notification_on_published.html.erb @@ -53,7 +53,7 @@ border-radius: 6px; color: #fff !important; font-weight: bold; padding: 17px 20px; text-align: center; text-decoration: none; font-size: 20px; min-width: 200px; display: inline-block;", - target: "_blank" do %> + target: "_blank" do %> <%= t("mailers.new_actions_notification_on_published.dashboard_button") %> <% end %> diff --git a/app/views/dashboard/polls/_poll.html.erb b/app/views/dashboard/polls/_poll.html.erb index bba6e946d..d858b1914 100644 --- a/app/views/dashboard/polls/_poll.html.erb +++ b/app/views/dashboard/polls/_poll.html.erb @@ -24,8 +24,9 @@ <% end %> - <%= form_for poll, remote: true, data: { type: :json }, - url: proposal_dashboard_poll_path(proposal, poll) do |f| %> + <%= form_for poll, remote: true, + data: { type: :json }, + url: proposal_dashboard_poll_path(proposal, poll) do |f| %> <%= f.check_box :results_enabled, class: "js-submit-on-change" %> <% end %>

    <%= t("dashboard.polls.poll.show_results_help") %>

    diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index 1466ea9a9..ba7dda780 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -6,13 +6,14 @@ <%= f.hidden_field :reset_password_token %>
    - <%= f.password_field :password, autofocus: true, autocomplete: "off", - label: t("devise_views.passwords.edit.password_label") %> + <%= f.password_field :password, autofocus: true, + autocomplete: "off", + label: t("devise_views.passwords.edit.password_label") %>
    <%= f.password_field :password_confirmation, autocomplete: "off", - label: t("devise_views.passwords.edit.password_confirmation_label") %> + label: t("devise_views.passwords.edit.password_confirmation_label") %>
    diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index ee0651187..ed250c31f 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -5,7 +5,7 @@
    <%= f.email_field :email, autofocus: true, - label: t("devise_views.unlocks.new.email_label") %> + label: t("devise_views.unlocks.new.email_label") %>
    diff --git a/app/views/documents/_document.html.erb b/app/views/documents/_document.html.erb index 977e3acc4..5f6b52378 100644 --- a/app/views/documents/_document.html.erb +++ b/app/views/documents/_document.html.erb @@ -1,7 +1,9 @@
  • <%= link_to t("documents.buttons.download_document"), - document.attachment, target: "_blank", - rel: "nofollow", class: "button hollow medium float-right" %> + document.attachment, + target: "_blank", + rel: "nofollow", + class: "button hollow medium float-right" %> <%= document.title %>
    diff --git a/app/views/legislation/processes/_process.html.erb b/app/views/legislation/processes/_process.html.erb index 8919ee848..42e333b40 100644 --- a/app/views/legislation/processes/_process.html.erb +++ b/app/views/legislation/processes/_process.html.erb @@ -6,7 +6,7 @@
    <%= link_to process, class: "button hollow big expanded", - title: t("legislation.processes.process.see_latest_comments_title") do %> + title: t("legislation.processes.process.see_latest_comments_title") do %>   <%= t("legislation.processes.process.see_latest_comments") %> <% end %> diff --git a/app/views/legislation/proposals/_form.html.erb b/app/views/legislation/proposals/_form.html.erb index 23e645d3b..83b6b9dd2 100644 --- a/app/views/legislation/proposals/_form.html.erb +++ b/app/views/legislation/proposals/_form.html.erb @@ -12,7 +12,7 @@
    <%= f.text_area :summary, rows: 4, maxlength: 200, - hint: t("proposals.form.proposal_summary_note") %> + hint: t("proposals.form.proposal_summary_note") %>
    @@ -54,10 +54,10 @@
    <%= f.text_field :tag_list, value: @proposal.tag_list.to_s, - label: false, - placeholder: t("proposals.form.tags_placeholder"), - class: "js-tag-list", - aria: { describedby: "tag-list-help-text" } %> + label: false, + placeholder: t("proposals.form.tags_placeholder"), + class: "js-tag-list", + aria: { describedby: "tag-list-help-text" } %>
    diff --git a/app/views/management/email_verifications/new.html.erb b/app/views/management/email_verifications/new.html.erb index 5245528e1..756ede6de 100644 --- a/app/views/management/email_verifications/new.html.erb +++ b/app/views/management/email_verifications/new.html.erb @@ -23,8 +23,9 @@

    <%= link_to t("management.users.create_user"), new_management_user_path(user: { - document_number: @email_verification.document_number, - document_type: @email_verification.document_type }), + document_number: @email_verification.document_number, + document_type: @email_verification.document_type + }), class: "button success" %>

  • diff --git a/app/views/management/user_invites/new.html.erb b/app/views/management/user_invites/new.html.erb index 59256c130..826e6115d 100644 --- a/app/views/management/user_invites/new.html.erb +++ b/app/views/management/user_invites/new.html.erb @@ -4,7 +4,7 @@

    <%= t("management.user_invites.new.info") %>

    <%= text_area_tag "emails", nil, rows: 5, - aria: { describedby: "emails-help-text" } %> + aria: { describedby: "emails-help-text" } %>
    " class="button expanded">
    diff --git a/app/views/notifications/index.html.erb b/app/views/notifications/index.html.erb index b4eef105b..e232b8fed 100644 --- a/app/views/notifications/index.html.erb +++ b/app/views/notifications/index.html.erb @@ -6,7 +6,8 @@ <%= link_to t("notifications.index.mark_all_as_read"), - mark_all_as_read_notifications_path, method: :put, + mark_all_as_read_notifications_path, + method: :put, class: "button hollow float-right-medium" %> \n" end it "accepts anchor tags" do @@ -29,8 +29,8 @@ describe Shared::LinkListComponent do ) expect(page).to be_rendered with: '\n" + '
  • Home
  • ' + "\n" + + '
  • Info
  • ' + "\n\n" end it "accepts options for links" do From 629e208e9da654e2a11dbd23569064f18e13b961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 1 Jul 2023 17:37:58 +0200 Subject: [PATCH 06/13] Add and apply ArgumentAlignment rubocop rule We're choosing the default `with_first_argument` style because it's the one we use the most. --- .rubocop.yml | 3 + .../budget_headings/form_component.html.erb | 14 ++-- .../budget_phases/form_component.html.erb | 6 +- .../budget_phases/phases_component.html.erb | 3 +- .../admin/budgets/form_component.html.erb | 10 +-- .../machine_learning/show_component.html.erb | 4 +- .../poll/officers/officers_component.html.erb | 3 +- .../poll/questions/form_component.html.erb | 6 +- .../roles/table_actions_component.html.erb | 3 +- app/components/attachable/fields_component.rb | 8 +-- .../executions/filters_component.html.erb | 23 +++---- .../investments/form_component.html.erb | 18 ++--- .../investments/my_ballot_component.html.erb | 13 ++-- .../investments/votes_component.html.erb | 30 ++++----- .../budgets/subheader_component.html.erb | 4 +- .../budgets/supports_info_component.html.erb | 2 +- .../comments/votes_component.html.erb | 12 ++-- .../debates/form_component.html.erb | 18 ++--- .../layout/footer_component.html.erb | 4 +- .../layout/login_items_component.html.erb | 20 +++--- .../layout/subnavigation_component.html.erb | 12 ++-- .../proposals/votes_component.html.erb | 8 +-- .../table_component.html.erb | 2 +- .../proposals/form_component.html.erb | 18 ++--- .../proposals/votes_component.html.erb | 10 +-- .../related_list_selector_component.html.erb | 16 ++--- .../shared/advanced_search_component.html.erb | 16 ++--- .../in_favor_against_component.html.erb | 20 +++--- .../shared/map_location_component.rb | 6 +- .../admin/local_census_records_controller.rb | 6 +- .../questions/answers/documents_controller.rb | 2 +- .../questions/answers/images_controller.rb | 2 +- .../questions/answers/videos_controller.rb | 2 +- .../poll/questions/answers_controller.rb | 4 +- .../budgets/investments/votes_controller.rb | 2 +- app/controllers/graphql_controller.rb | 3 +- .../budgets/investments/votes_controller.rb | 2 +- app/helpers/links_helper.rb | 2 +- app/helpers/proposals_dashboard_helper.rb | 6 +- app/models/abilities/administrator.rb | 2 +- app/models/abilities/common.rb | 6 +- app/models/budget/investment.rb | 6 +- app/models/budget/voting_styles/base.rb | 4 +- app/models/concerns/attachable.rb | 38 +++++------ app/models/concerns/relationable.rb | 6 +- app/models/legislation/draft_version.rb | 6 +- app/models/legislation/process.rb | 24 +++---- app/models/poll.rb | 8 ++- app/models/poll/question.rb | 6 +- app/models/tenant.rb | 8 +-- app/models/user.rb | 66 +++++++++---------- app/models/verification/management/email.rb | 4 +- .../admin/admin_notifications/index.html.erb | 5 +- app/views/admin/banners/_form.html.erb | 4 +- app/views/admin/banners/index.html.erb | 3 +- .../_filters_description.html.erb | 8 +-- .../budget_investments/_investments.html.erb | 3 +- .../_written_by_author.html.erb | 6 +- .../admin/budget_investments/edit.html.erb | 24 +++---- .../admin/dashboard/actions/_form.html.erb | 5 +- .../admin/dashboard/actions/index.html.erb | 3 +- .../administrator_tasks/index.html.erb | 3 +- .../admin/emails_download/index.html.erb | 4 +- .../legislation/draft_versions/_form.html.erb | 4 +- .../legislation/questions/_form.html.erb | 4 +- .../imports/show.html.erb | 12 ++-- app/views/admin/milestones/_form.html.erb | 6 +- .../admin/milestones/_milestones.html.erb | 6 +- app/views/admin/newsletters/index.html.erb | 5 +- app/views/admin/newsletters/new.html.erb | 4 +- .../_booth_assignment.html.erb | 3 +- app/views/admin/poll/polls/_poll.html.erb | 3 +- .../poll/questions/answers/_form.html.erb | 2 +- app/views/admin/poll/shifts/_form.html.erb | 22 +++---- .../poll/shifts/_search_officers.html.erb | 6 +- app/views/admin/poll/shifts/_shifts.html.erb | 3 +- .../_content_types_settings_form.html.erb | 4 +- app/views/admin/settings/_map_form.html.erb | 2 +- .../admin/settings/_settings_form.html.erb | 8 +-- .../shared/_budget_investment_search.html.erb | 6 +- app/views/admin/signature_sheets/new.html.erb | 2 +- .../admin/signature_sheets/show.html.erb | 6 +- .../_globalize_locales.html.erb | 6 +- app/views/admin/stats/show.html.erb | 4 +- .../_proposal_notification_digest.html.erb | 8 +-- app/views/admin/tags/index.html.erb | 8 +-- app/views/budgets/executions/show.html.erb | 6 +- .../budgets/investments/_header.html.erb | 6 +- .../budgets/investments/_investment.html.erb | 8 +-- .../investments/_investment_detail.html.erb | 4 +- .../investments/_investment_show.html.erb | 41 ++++++------ .../budgets/investments/_sidebar.html.erb | 5 +- app/views/budgets/investments/index.html.erb | 6 +- app/views/budgets/investments/show.html.erb | 6 +- app/views/budgets/results/show.html.erb | 6 +- app/views/budgets/stats/show.html.erb | 6 +- app/views/comments/_form.html.erb | 14 ++-- app/views/communities/_poll.html.erb | 3 +- app/views/dashboard/_goal.html.erb | 4 +- .../dashboard/_mailing_resource.html.erb | 4 +- app/views/dashboard/_poll_resource.html.erb | 4 +- app/views/dashboard/_poster_resource.html.erb | 4 +- app/views/dashboard/community.html.erb | 2 +- ...actions_notification_on_published.html.erb | 14 ++-- app/views/dashboard/polls/_form.html.erb | 12 ++-- app/views/debates/_actions.html.erb | 10 ++- app/views/debates/index.html.erb | 2 +- app/views/debates/show.html.erb | 10 +-- app/views/devise/confirmations/show.html.erb | 6 +- app/views/devise/sessions/new.html.erb | 2 +- app/views/direct_messages/new.html.erb | 5 +- app/views/direct_messages/show.html.erb | 2 +- app/views/documents/_document.html.erb | 8 +-- app/views/layouts/application.html.erb | 18 +++-- app/views/layouts/dashboard.html.erb | 6 +- .../annotations/_comments_box.html.erb | 8 +-- .../legislation/draft_versions/show.html.erb | 2 +- .../legislation/processes/_header.html.erb | 17 ++--- .../legislation/processes/_help_gif.html.erb | 3 +- .../legislation/processes/summary.html.erb | 4 +- .../legislation/proposals/_form.html.erb | 16 ++--- app/views/legislation/proposals/show.html.erb | 20 +++--- .../_participation_not_allowed.html.erb | 5 +- .../mailer/budget_investment_created.html.erb | 5 +- .../direct_message_for_receiver.html.erb | 2 +- app/views/mailer/user_invite.html.erb | 6 +- app/views/management/_account_info.html.erb | 6 +- .../budgets/investments/index.html.erb | 6 +- .../budgets/investments/print.html.erb | 6 +- .../invalid_document.html.erb | 6 +- .../document_verifications/new.html.erb | 8 +-- .../document_verifications/verified.html.erb | 4 +- .../email_verifications/new.html.erb | 4 +- .../email_verifications/sent.html.erb | 4 +- app/views/management/users/new.html.erb | 8 +-- app/views/management/users/show.html.erb | 4 +- app/views/milestones/_milestone.html.erb | 6 +- .../notifications/_notification.html.erb | 14 ++-- app/views/notifications/index.html.erb | 6 +- .../officing/ballot_sheets/index.html.erb | 2 +- app/views/officing/ballot_sheets/new.html.erb | 4 +- app/views/officing/results/new.html.erb | 4 +- .../organizations/registrations/new.html.erb | 18 ++--- .../registrations/success.html.erb | 3 +- app/views/pages/help/_budgets.html.erb | 2 +- app/views/pages/help/_debates.html.erb | 8 +-- app/views/pages/help/_polls.html.erb | 6 +- app/views/pages/help/_processes.html.erb | 4 +- app/views/pages/help/_proposals.html.erb | 2 +- app/views/polls/_callout.html.erb | 6 +- app/views/polls/_poll_header.html.erb | 10 +-- app/views/polls/show.html.erb | 10 +-- app/views/proposal_notifications/new.html.erb | 6 +- app/views/proposals/_info.html.erb | 4 +- app/views/proposals/_social_share.html.erb | 18 ++--- app/views/proposals/_supports.html.erb | 2 +- app/views/proposals/retire_form.html.erb | 10 +-- app/views/proposals/share.html.erb | 14 ++-- app/views/proposals/show.html.erb | 10 +-- app/views/relationable/_form.html.erb | 4 +- app/views/shared/_filter_subnav.html.erb | 2 +- .../shared/_filter_subnav_vertical.html.erb | 2 +- app/views/shared/_globalize_locales.html.erb | 6 +- app/views/shared/_suggest.html.erb | 10 +-- app/views/topics/_informative_text.html.erb | 3 +- app/views/topics/show.html.erb | 7 +- .../users/registrations/delete_form.html.erb | 4 +- app/views/users/registrations/edit.html.erb | 20 +++--- app/views/users/registrations/new.html.erb | 15 +++-- .../users/registrations/success.html.erb | 3 +- .../budget_investments/_dossier_form.html.erb | 14 ++-- app/views/verification/residence/new.html.erb | 14 ++-- app/views/welcome/index.html.erb | 6 +- bin/rspec | 2 +- ...4152_add_time_zone_to_default_datetimes.rb | 8 +-- .../components/sdg/tag_list_component_spec.rb | 4 +- .../targets/plain_tag_list_component_spec.rb | 4 +- .../sdg/targets/tag_list_component_spec.rb | 16 ++--- .../valuation/budgets/row_component_spec.rb | 12 ++-- spec/factories/polls.rb | 4 +- spec/i18n_spec.rb | 4 +- spec/models/dashboard/action_spec.rb | 16 ++--- spec/models/legislation/annotation_spec.rb | 9 ++- spec/models/user_spec.rb | 20 +++--- spec/system/admin/budget_investments_spec.rb | 56 ++++++++-------- .../admin/poll/booth_assigments_spec.rb | 40 +++++------ spec/system/admin/poll/polls_spec.rb | 16 ++--- .../site_customization/content_blocks_spec.rb | 4 +- spec/system/admin/system_emails_spec.rb | 13 +++- spec/system/admin/widgets/cards_spec.rb | 4 +- spec/system/budgets/ballots_spec.rb | 6 +- spec/system/budgets/investments_spec.rb | 14 ++-- .../comments/budget_investments_spec.rb | 6 +- spec/system/dashboard/dashboard_spec.rb | 22 +++---- spec/system/home_spec.rb | 3 +- spec/system/legislation/summary_spec.rb | 4 +- .../moderation/budget_investments_spec.rb | 9 ++- spec/system/officing/results_spec.rb | 30 +++++---- spec/system/proposal_notifications_spec.rb | 14 ++-- spec/system/proposals_spec.rb | 2 +- .../site_customization/custom_pages_spec.rb | 15 +++-- spec/system/verification/residence_spec.rb | 4 +- 202 files changed, 907 insertions(+), 830 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 4315154ae..982341268 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -18,6 +18,9 @@ Bundler/OrderedGems: Enabled: true ConsiderPunctuation: true +Layout/ArgumentAlignment: + Enabled: true + Layout/ArrayAlignment: Enabled: true diff --git a/app/components/admin/budget_headings/form_component.html.erb b/app/components/admin/budget_headings/form_component.html.erb index af488f177..f41f0d14b 100644 --- a/app/components/admin/budget_headings/form_component.html.erb +++ b/app/components/admin/budget_headings/form_component.html.erb @@ -20,20 +20,20 @@ <% if feature?(:map) %> <%= f.select :geozone_id, - geozone_options, - include_blank: t("geozones.none"), - hint: t("admin.budget_headings.form.geozone_info") %> + geozone_options, + include_blank: t("geozones.none"), + hint: t("admin.budget_headings.form.geozone_info") %> <% end %> <% if heading.budget.approval_voting? %> <%= f.number_field :max_ballot_lines, - hint: t("admin.budget_headings.form.max_ballot_lines_info") %> + hint: t("admin.budget_headings.form.max_ballot_lines_info") %> <% end %> <%= f.text_field :population, - maxlength: 8, - data: { toggle_focus: "population-info" }, - hint: t("admin.budget_headings.form.population_info") %> + maxlength: 8, + data: { toggle_focus: "population-info" }, + hint: t("admin.budget_headings.form.population_info") %> <%= f.text_field :latitude, maxlength: 22 %> <%= f.text_field :longitude, maxlength: 22 %> diff --git a/app/components/admin/budget_phases/form_component.html.erb b/app/components/admin/budget_phases/form_component.html.erb index dc0ed15ea..369373454 100644 --- a/app/components/admin/budget_phases/form_component.html.erb +++ b/app/components/admin/budget_phases/form_component.html.erb @@ -39,9 +39,9 @@
    <%= translations_form.text_area :description, - maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH, - class: "html-area", - hint: t("admin.budget_phases.edit.description_help_text") %> + maxlength: Budget::Phase::DESCRIPTION_MAX_LENGTH, + class: "html-area", + hint: t("admin.budget_phases.edit.description_help_text") %>
    diff --git a/app/components/admin/budget_phases/phases_component.html.erb b/app/components/admin/budget_phases/phases_component.html.erb index 3d68ac7e4..6205390a4 100644 --- a/app/components/admin/budget_phases/phases_component.html.erb +++ b/app/components/admin/budget_phases/phases_component.html.erb @@ -29,7 +29,8 @@ <%= enabled_cell(phase) %> - <%= render Admin::TableActionsComponent.new(phase, + <%= render Admin::TableActionsComponent.new( + phase, actions: [:edit], edit_path: edit_path(phase) ) %> diff --git a/app/components/admin/budgets/form_component.html.erb b/app/components/admin/budgets/form_component.html.erb index dd9bbddc9..38cc4e6f6 100644 --- a/app/components/admin/budgets/form_component.html.erb +++ b/app/components/admin/budgets/form_component.html.erb @@ -10,8 +10,8 @@
    <%= translations_form.text_field :name, - maxlength: Budget.title_max_length, - hint: t("admin.budgets.edit.name_description") %> + maxlength: Budget.title_max_length, + hint: t("admin.budgets.edit.name_description") %>
    @@ -67,9 +67,9 @@ <% %w[administrators valuators].each do |staff| %>
    <%= link_to t("admin.budgets.edit.#{staff}", count: budget.send(staff).count), - "#", - class: "button expanded hollow js-budget-show-#{staff}-list js-budget-show-users-list", - data: { toggle: "#{staff}_list", texts: t("admin.budgets.edit.#{staff}") } %> + "#", + class: "button expanded hollow js-budget-show-#{staff}-list js-budget-show-users-list", + data: { toggle: "#{staff}_list", texts: t("admin.budgets.edit.#{staff}") } %>
    <% end %> diff --git a/app/components/admin/machine_learning/show_component.html.erb b/app/components/admin/machine_learning/show_component.html.erb index 79dc8760c..48482bd3d 100644 --- a/app/components/admin/machine_learning/show_component.html.erb +++ b/app/components/admin/machine_learning/show_component.html.erb @@ -32,8 +32,8 @@

    <%= sanitize(t("admin.machine_learning.feature_disabled", - link: link_to(t("admin.machine_learning.feature_disabled_link"), - admin_settings_path(anchor: "tab-feature-flags")))) %> + link: link_to(t("admin.machine_learning.feature_disabled_link"), + admin_settings_path(anchor: "tab-feature-flags")))) %>

    <% end %> diff --git a/app/components/admin/poll/officers/officers_component.html.erb b/app/components/admin/poll/officers/officers_component.html.erb index 54784ebaf..d31d85f9a 100644 --- a/app/components/admin/poll/officers/officers_component.html.erb +++ b/app/components/admin/poll/officers/officers_component.html.erb @@ -17,7 +17,8 @@ <% if officer.persisted? %> - <%= render Admin::TableActionsComponent.new(officer, + <%= render Admin::TableActionsComponent.new( + officer, actions: [:destroy], destroy_text: t("admin.poll_officers.officer.delete"), destroy_options: { class: "destroy-officer-link" } diff --git a/app/components/admin/poll/questions/form_component.html.erb b/app/components/admin/poll/questions/form_component.html.erb index bd72edd40..e8dd29a77 100644 --- a/app/components/admin/poll/questions/form_component.html.erb +++ b/app/components/admin/poll/questions/form_component.html.erb @@ -13,9 +13,9 @@ <% else %>
    <%= f.select :poll_id, - options_for_select(select_options), - prompt: t("admin.questions.index.select_poll"), - hint: t("admin.questions.form.poll_help") %> + options_for_select(select_options), + prompt: t("admin.questions.index.select_poll"), + hint: t("admin.questions.form.poll_help") %>
    <% end %>
    diff --git a/app/components/admin/roles/table_actions_component.html.erb b/app/components/admin/roles/table_actions_component.html.erb index 305c18ed4..d5d2deada 100644 --- a/app/components/admin/roles/table_actions_component.html.erb +++ b/app/components/admin/roles/table_actions_component.html.erb @@ -1,5 +1,6 @@ <% if already_has_role? %> - <%= render Admin::TableActionsComponent.new(record, + <%= render Admin::TableActionsComponent.new( + record, actions: actions, destroy_options: { class: "destroy-role-link" } ) %> diff --git a/app/components/attachable/fields_component.rb b/app/components/attachable/fields_component.rb index ae217456a..d26340d70 100644 --- a/app/components/attachable/fields_component.rb +++ b/app/components/attachable/fields_component.rb @@ -46,10 +46,10 @@ class Attachable::FieldsComponent < ApplicationComponent def file_field klass = attachable.persisted? || attachable.cached_attachment.present? ? " hide" : "" f.file_field :attachment, - label_options: { class: "button hollow #{klass}" }, - accept: accepted_content_types_extensions, - class: "js-#{singular_name}-attachment", - data: { url: direct_upload_path } + label_options: { class: "button hollow #{klass}" }, + accept: accepted_content_types_extensions, + class: "js-#{singular_name}-attachment", + data: { url: direct_upload_path } end def direct_upload_path diff --git a/app/components/budgets/executions/filters_component.html.erb b/app/components/budgets/executions/filters_component.html.erb index eed52e564..83d4c13cc 100644 --- a/app/components/budgets/executions/filters_component.html.erb +++ b/app/components/budgets/executions/filters_component.html.erb @@ -2,21 +2,22 @@
    <%= label_tag :milestone_tag, t("budgets.executions.filters.milestone_tag.label") %> <%= select_tag :milestone_tag, - options_for_select( - options_for_milestone_tags, - params[:milestone_tag] - ), - prompt: t("budgets.executions.filters.milestone_tag.all", - count: budget.investments.winners.with_milestones.count) %> + options_for_select( + options_for_milestone_tags, + params[:milestone_tag] + ), + prompt: t("budgets.executions.filters.milestone_tag.all", + count: budget.investments.winners.with_milestones.count) %>
    <%= label_tag :status, t("budgets.executions.filters.status.label") %> <%= select_tag :status, - options_from_collection_for_select(statuses, - :id, lambda { |s| "#{s.name} (#{filters_select_counts(s.id)})" }, - params[:status]), - prompt: t("budgets.executions.filters.status.all", - count: budget.investments.winners.with_milestones.count) %> + options_from_collection_for_select(statuses, + :id, + lambda { |s| "#{s.name} (#{filters_select_counts(s.id)})" }, + params[:status]), + prompt: t("budgets.executions.filters.status.all", + count: budget.investments.winners.with_milestones.count) %>
    <%= submit_tag t("shared.filter") %> diff --git a/app/components/budgets/investments/form_component.html.erb b/app/components/budgets/investments/form_component.html.erb index 0b52328f3..9b28cb0ed 100644 --- a/app/components/budgets/investments/form_component.html.erb +++ b/app/components/budgets/investments/form_component.html.erb @@ -18,15 +18,15 @@ <%= f.translatable_fields do |translations_form| %>
    <%= translations_form.text_field :title, - maxlength: Budget::Investment.title_max_length, - data: suggest_data(investment) %> + maxlength: Budget::Investment.title_max_length, + data: suggest_data(investment) %>
    <%= translations_form.text_area :description, - maxlength: Budget::Investment.description_max_length, - class: "html-area" %> + maxlength: Budget::Investment.description_max_length, + class: "html-area" %>
    <% end %> @@ -94,11 +94,11 @@ <% unless current_user.manager? || investment.persisted? %>
    <%= f.check_box :terms_of_service, - title: t("form.accept_terms_title"), - label: t("form.accept_terms", - policy: link_to(t("form.policy"), "/privacy", target: "blank"), - conditions: link_to(t("form.conditions"), "/conditions", target: "blank") - ) %> + title: t("form.accept_terms_title"), + label: t("form.accept_terms", + policy: link_to(t("form.policy"), "/privacy", target: "blank"), + conditions: link_to(t("form.conditions"), "/conditions", target: "blank") + ) %>
    <% end %> diff --git a/app/components/budgets/investments/my_ballot_component.html.erb b/app/components/budgets/investments/my_ballot_component.html.erb index e44105a26..bf141f63e 100644 --- a/app/components/budgets/investments/my_ballot_component.html.erb +++ b/app/components/budgets/investments/my_ballot_component.html.erb @@ -10,13 +10,12 @@ <% elsif assigned_heading.present? %>

    <%= sanitize(t("budgets.investments.index.sidebar.different_heading_assigned", - heading_link: heading_link(assigned_heading, budget) - )) %> + heading_link: heading_link(assigned_heading, budget))) %>
    <%= sanitize(t("budgets.investments.index.sidebar.change_ballot", - check_ballot: link_to(t("budgets.investments.index.sidebar.check_ballot_link"), - budget_ballot_path(budget)))) %> + check_ballot: link_to(t("budgets.investments.index.sidebar.check_ballot_link"), + budget_ballot_path(budget)))) %>

    <% else %> @@ -26,7 +25,7 @@

    <%= sanitize(ballot.change_vote_info( link: link_to(t("budgets.investments.index.sidebar.change_vote_link"), - budget_ballot_path(budget)))) %> + budget_ballot_path(budget)))) %>

      @@ -39,6 +38,6 @@
    <%= link_to t("budgets.investments.header.check_ballot"), - budget_ballot_path(budget), - class: "button hollow expanded" %> + budget_ballot_path(budget), + class: "button hollow expanded" %>
    diff --git a/app/components/budgets/investments/votes_component.html.erb b/app/components/budgets/investments/votes_component.html.erb index 89612f4b6..015e520c9 100644 --- a/app/components/budgets/investments/votes_component.html.erb +++ b/app/components/budgets/investments/votes_component.html.erb @@ -13,22 +13,22 @@
    <% if feature?(:remove_investments_supports) %> <%= button_to remove_support_path, - class: "button button-remove-support expanded", - method: "delete", - remote: true, - "aria-label": remove_support_aria_label do %> + class: "button button-remove-support expanded", + method: "delete", + remote: true, + "aria-label": remove_support_aria_label do %> <%= t("budgets.investments.votes.remove_support") %> <% end %> <% end %> <% else %> <%= button_to t("budgets.investments.votes.support"), support_path, - class: "button button-support expanded", - title: t("budgets.investments.investment.support_title"), - method: "post", - remote: !display_support_alert?, - data: ({ confirm: confirm_vote_message } if display_support_alert?), - "aria-label": support_aria_label %> + class: "button button-support expanded", + title: t("budgets.investments.investment.support_title"), + method: "post", + remote: !display_support_alert?, + data: ({ confirm: confirm_vote_message } if display_support_alert?), + "aria-label": support_aria_label %> <% end %> <% end %> @@ -38,11 +38,11 @@ <% if user_voted_for? && setting["twitter_handle"] %> <% end %> diff --git a/app/components/budgets/subheader_component.html.erb b/app/components/budgets/subheader_component.html.erb index 6e97da27a..82d85686f 100644 --- a/app/components/budgets/subheader_component.html.erb +++ b/app/components/budgets/subheader_component.html.erb @@ -16,13 +16,13 @@ <% else %>
    <%= sanitize(t("budgets.investments.index.sidebar.verified_only", - verify: link_to_verify_account)) %> + verify: link_to_verify_account)) %>
    <% end %> <% else %>
    <%= sanitize(t("budgets.investments.index.sidebar.not_logged_in", - sign_in: link_to_signin, sign_up: link_to_signup)) %> + sign_in: link_to_signin, sign_up: link_to_signup)) %>
    <% end %> <% end %> diff --git a/app/components/budgets/supports_info_component.html.erb b/app/components/budgets/supports_info_component.html.erb index 7980b7eb9..2516b1e89 100644 --- a/app/components/budgets/supports_info_component.html.erb +++ b/app/components/budgets/supports_info_component.html.erb @@ -14,7 +14,7 @@

    <%= t("budgets.supports_info.time", - phase_end_date: l(budget.current_phase.ends_at.to_date, format: :long)) %>

    + phase_end_date: l(budget.current_phase.ends_at.to_date, format: :long)) %>

    <%= t("budgets.supports_info.share") %>

    diff --git a/app/components/comments/votes_component.html.erb b/app/components/comments/votes_component.html.erb index b765af80f..9e3deae86 100644 --- a/app/components/comments/votes_component.html.erb +++ b/app/components/comments/votes_component.html.erb @@ -4,9 +4,9 @@ <%= button_to vote_comment_path(comment, value: "yes"), - method: "post", - remote: can?(:vote, comment), - title: t("votes.agree") do %> + method: "post", + remote: can?(:vote, comment), + title: t("votes.agree") do %> <%= t("votes.agree") %> <% end %> <%= comment.total_likes %> @@ -14,9 +14,9 @@ <%= button_to vote_comment_path(comment, value: "no"), - method: "post", - remote: can?(:vote, comment), - title: t("votes.disagree") do %> + method: "post", + remote: can?(:vote, comment), + title: t("votes.disagree") do %> <%= t("votes.disagree") %> <% end %> <%= comment.total_dislikes %> diff --git a/app/components/debates/form_component.html.erb b/app/components/debates/form_component.html.erb index 42aa1d38f..3733960cd 100644 --- a/app/components/debates/form_component.html.erb +++ b/app/components/debates/form_component.html.erb @@ -9,15 +9,15 @@ <%= f.translatable_fields do |translations_form| %>
    <%= translations_form.text_field :title, - maxlength: Debate.title_max_length, - data: suggest_data(debate) %> + maxlength: Debate.title_max_length, + data: suggest_data(debate) %>
    <%= translations_form.text_area :description, - maxlength: Debate.description_max_length, - class: "html-area" %> + maxlength: Debate.description_max_length, + class: "html-area" %>
    <% end %> @@ -42,11 +42,11 @@ <% if debate.new_record? %>
    <%= f.check_box :terms_of_service, - title: t("form.accept_terms_title"), - label: t("form.accept_terms", - policy: link_to(t("form.policy"), "/privacy", target: "blank"), - conditions: link_to(t("form.conditions"), "/conditions", target: "blank") - ) %> + title: t("form.accept_terms_title"), + label: t("form.accept_terms", + policy: link_to(t("form.policy"), "/privacy", target: "blank"), + conditions: link_to(t("form.conditions"), "/conditions", target: "blank") + ) %>
    <% end %> diff --git a/app/components/layout/footer_component.html.erb b/app/components/layout/footer_component.html.erb index 1dea274fc..979ecc556 100644 --- a/app/components/layout/footer_component.html.erb +++ b/app/components/layout/footer_component.html.erb @@ -7,8 +7,8 @@

    <%= sanitize(t("layouts.footer.description", - open_source: link_to(t("layouts.footer.open_source"), t("layouts.footer.open_source_url"), target: "blank", rel: "nofollow"), - consul: link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), target: "blank", rel: "nofollow"))) %> + open_source: link_to(t("layouts.footer.open_source"), t("layouts.footer.open_source_url"), target: "blank", rel: "nofollow"), + consul: link_to(t("layouts.footer.consul"), t("layouts.footer.consul_url"), target: "blank", rel: "nofollow"))) %>

    diff --git a/app/components/layout/login_items_component.html.erb b/app/components/layout/login_items_component.html.erb index b2acca46e..048ef300d 100644 --- a/app/components/layout/login_items_component.html.erb +++ b/app/components/layout/login_items_component.html.erb @@ -1,19 +1,19 @@ <% if user %>
  • <%= layout_menu_link_to t("layouts.header.my_activity_link"), - user_path(user), - controller_name == "users", - rel: "nofollow", - title: t("shared.go_to_page") + - t("layouts.header.my_activity_link") %> + user_path(user), + controller_name == "users", + rel: "nofollow", + title: t("shared.go_to_page") + + t("layouts.header.my_activity_link") %>
  • <%= layout_menu_link_to t("layouts.header.my_account_link"), - account_path, - controller_name == "account", - rel: "nofollow", - title: t("shared.go_to_page") + - t("layouts.header.my_account_link") %> + account_path, + controller_name == "account", + rel: "nofollow", + title: t("shared.go_to_page") + + t("layouts.header.my_account_link") %>
  • <%= link_to t("devise_views.menu.login_items.logout"), diff --git a/app/components/layout/subnavigation_component.html.erb b/app/components/layout/subnavigation_component.html.erb index 4df7ff1d8..d21b926e5 100644 --- a/app/components/layout/subnavigation_component.html.erb +++ b/app/components/layout/subnavigation_component.html.erb @@ -21,9 +21,9 @@ <% if feature?(:polls) %>
  • <%= layout_menu_link_to t("layouts.header.poll_questions"), - polls_path, - controller_name == "polls" || (controller_name == "questions" && controller.class.module_parent == Polls), - accesskey: "3" %> + polls_path, + controller_name == "polls" || (controller_name == "questions" && controller.class.module_parent == Polls), + accesskey: "3" %>
  • <% end %> <% if feature?(:legislation) %> @@ -37,9 +37,9 @@ <% if feature?(:budgets) %>
  • <%= layout_menu_link_to t("layouts.header.budgets"), - budgets_path, - controller_name == "budgets" || controller_name == "investments", - accesskey: "5" %> + budgets_path, + controller_name == "budgets" || controller_name == "investments", + accesskey: "5" %>
  • <% end %> <% if feature?(:sdg) %> diff --git a/app/components/legislation/proposals/votes_component.html.erb b/app/components/legislation/proposals/votes_component.html.erb index 84e1bd29e..630163492 100644 --- a/app/components/legislation/proposals/votes_component.html.erb +++ b/app/components/legislation/proposals/votes_component.html.erb @@ -12,10 +12,10 @@ <% if current_user&.voted_as_when_voted_for(proposal) && setting["twitter_handle"] %> <% end %> diff --git a/app/components/management/budgets/print_investments/table_component.html.erb b/app/components/management/budgets/print_investments/table_component.html.erb index 424ae41b2..16769ec4d 100644 --- a/app/components/management/budgets/print_investments/table_component.html.erb +++ b/app/components/management/budgets/print_investments/table_component.html.erb @@ -13,7 +13,7 @@ <%= budget.current_phase.name %> <%= link_to t("management.budgets.print_investments"), - print_management_budget_investments_path(budget) %> + print_management_budget_investments_path(budget) %> <% end %> diff --git a/app/components/proposals/form_component.html.erb b/app/components/proposals/form_component.html.erb index 727606511..5a99d7e37 100644 --- a/app/components/proposals/form_component.html.erb +++ b/app/components/proposals/form_component.html.erb @@ -9,8 +9,8 @@ <%= f.translatable_fields do |translations_form| %>
    <%= translations_form.text_field :title, - maxlength: Proposal.title_max_length, - data: suggest_data(proposal) %> + maxlength: Proposal.title_max_length, + data: suggest_data(proposal) %>
    @@ -52,7 +52,7 @@ <% if Geozone.any? %>
    <%= f.select :geozone_id, geozone_select_options, - include_blank: t("geozones.none") %> + include_blank: t("geozones.none") %>
    <% end %> @@ -90,7 +90,7 @@ <% if current_user.unverified? %>
    <%= f.text_field :responsible_name, - hint: t("proposals.form.proposal_responsible_name_note") %> + hint: t("proposals.form.proposal_responsible_name_note") %>
    <% end %> @@ -101,11 +101,11 @@ <% if proposal.new_record? %>
    <%= f.check_box :terms_of_service, - title: t("form.accept_terms_title"), - label: t("form.accept_terms", - policy: link_to(t("form.policy"), "/privacy", target: "blank"), - conditions: link_to(t("form.conditions"), "/conditions", target: "blank") - ) %> + title: t("form.accept_terms_title"), + label: t("form.accept_terms", + policy: link_to(t("form.policy"), "/privacy", target: "blank"), + conditions: link_to(t("form.conditions"), "/conditions", target: "blank") + ) %>
    <% end %> diff --git a/app/components/proposals/votes_component.html.erb b/app/components/proposals/votes_component.html.erb index 7e87fe6ec..c96200e00 100644 --- a/app/components/proposals/votes_component.html.erb +++ b/app/components/proposals/votes_component.html.erb @@ -8,11 +8,11 @@ <% else %> <%= button_to vote_url, - class: "button button-support small expanded", - title: t("proposals.proposal.support_title"), - method: "post", - remote: true, - "aria-label": support_aria_label do %> + class: "button button-support small expanded", + title: t("proposals.proposal.support_title"), + method: "post", + remote: true, + "aria-label": support_aria_label do %> <%= t("proposals.proposal.support") %> <% end %> <% end %> diff --git a/app/components/sdg/related_list_selector_component.html.erb b/app/components/sdg/related_list_selector_component.html.erb index 36fe5a0ba..6e7f5bbf5 100644 --- a/app/components/sdg/related_list_selector_component.html.erb +++ b/app/components/sdg/related_list_selector_component.html.erb @@ -12,15 +12,15 @@ <%= f.text_field :related_sdg_list, - class: "input", - hint: sanitize(t("sdg.related_list_selector.hint", + class: "input", + hint: sanitize(t("sdg.related_list_selector.hint", link: link_to(t("sdg.related_list_selector.help.text"), - sdg_help_path, - title: t("shared.target_blank"), - target: "_blank")), - attributes: %w[href title target]), - data: { "suggestions-list": sdg_related_suggestions, - "remove-tag-text": t("sdg.related_list_selector.remove_tag") } %> + sdg_help_path, + title: t("shared.target_blank"), + target: "_blank")), + attributes: %w[href title target]), + data: { "suggestions-list": sdg_related_suggestions, + "remove-tag-text": t("sdg.related_list_selector.remove_tag") } %>
    diff --git a/app/components/shared/advanced_search_component.html.erb b/app/components/shared/advanced_search_component.html.erb index 8a138f529..0182d5936 100644 --- a/app/components/shared/advanced_search_component.html.erb +++ b/app/components/shared/advanced_search_component.html.erb @@ -15,8 +15,8 @@
    <%= select_tag("advanced_search[date_min]", date_range_options, - include_blank: t("shared.advanced_search.date_range_blank"), - id: "js-advanced-search-date-min") %> + include_blank: t("shared.advanced_search.date_range_blank"), + id: "js-advanced-search-date-min") %>
    <%= text_field_tag "advanced_search[date_max]", - advanced_search[:date_max], - class: "js-calendar" %> + advanced_search[:date_max], + class: "js-calendar" %>
    @@ -43,12 +43,12 @@
    <%= select_tag("advanced_search[goal]", goal_options, - include_blank: t("shared.advanced_search.goal_blank")) %> + include_blank: t("shared.advanced_search.goal_blank")) %>
    <%= select_tag("advanced_search[target]", target_options, - include_blank: t("shared.advanced_search.target_blank")) %> + include_blank: t("shared.advanced_search.target_blank")) %>
    <% end %> diff --git a/app/components/shared/in_favor_against_component.html.erb b/app/components/shared/in_favor_against_component.html.erb index 5d9739052..b78e245f2 100644 --- a/app/components/shared/in_favor_against_component.html.erb +++ b/app/components/shared/in_favor_against_component.html.erb @@ -1,11 +1,11 @@
    <%= button_to polymorphic_path(votable, action: :vote, value: "yes"), - class: "like #{voted_classes[:in_favor]}", - title: t("votes.agree"), - "aria-label": agree_aria_label, - method: "post", - remote: true do %> + class: "like #{voted_classes[:in_favor]}", + title: t("votes.agree"), + "aria-label": agree_aria_label, + method: "post", + remote: true do %> <%= t("votes.agree") %> <% end %> <%= votes_percentage("likes", votable) %> @@ -13,11 +13,11 @@
    <%= button_to polymorphic_path(votable, action: :vote, value: "no"), - class: "unlike #{voted_classes[:against]}", - title: t("votes.disagree"), - "aria-label": disagree_aria_label, - method: "post", - remote: true do %> + class: "unlike #{voted_classes[:against]}", + title: t("votes.disagree"), + "aria-label": disagree_aria_label, + method: "post", + remote: true do %> <%= t("votes.disagree") %> <% end %> <%= votes_percentage("dislikes", votable) %> diff --git a/app/components/shared/map_location_component.rb b/app/components/shared/map_location_component.rb index e82f1f8a1..b4fbca49e 100644 --- a/app/components/shared/map_location_component.rb +++ b/app/components/shared/map_location_component.rb @@ -40,9 +40,9 @@ class Shared::MapLocationComponent < ApplicationComponent def remove_marker button_tag remove_marker_label, - id: remove_marker_id, - class: "map-location-remove-marker", - type: "button" + id: remove_marker_id, + class: "map-location-remove-marker", + type: "button" end def data diff --git a/app/controllers/admin/local_census_records_controller.rb b/app/controllers/admin/local_census_records_controller.rb index a30fc8efc..5c23342f5 100644 --- a/app/controllers/admin/local_census_records_controller.rb +++ b/app/controllers/admin/local_census_records_controller.rb @@ -10,7 +10,7 @@ class Admin::LocalCensusRecordsController < Admin::BaseController @local_census_record = LocalCensusRecord.new(local_census_record_params) if @local_census_record.save redirect_to admin_local_census_records_path, - notice: t("admin.local_census_records.create.notice") + notice: t("admin.local_census_records.create.notice") else render :new end @@ -19,7 +19,7 @@ class Admin::LocalCensusRecordsController < Admin::BaseController def update if @local_census_record.update(local_census_record_params) redirect_to admin_local_census_records_path, - notice: t("admin.local_census_records.update.notice") + notice: t("admin.local_census_records.update.notice") else render :edit end @@ -28,7 +28,7 @@ class Admin::LocalCensusRecordsController < Admin::BaseController def destroy @local_census_record.destroy! redirect_to admin_local_census_records_path, - notice: t("admin.local_census_records.destroy.notice") + notice: t("admin.local_census_records.destroy.notice") end private diff --git a/app/controllers/admin/poll/questions/answers/documents_controller.rb b/app/controllers/admin/poll/questions/answers/documents_controller.rb index 4fce04d05..6eb70dcc8 100644 --- a/app/controllers/admin/poll/questions/answers/documents_controller.rb +++ b/app/controllers/admin/poll/questions/answers/documents_controller.rb @@ -12,7 +12,7 @@ class Admin::Poll::Questions::Answers::DocumentsController < Admin::Poll::BaseCo if @answer.save redirect_to admin_answer_documents_path(@answer), - notice: t("admin.documents.create.success_notice") + notice: t("admin.documents.create.success_notice") else render :index end diff --git a/app/controllers/admin/poll/questions/answers/images_controller.rb b/app/controllers/admin/poll/questions/answers/images_controller.rb index 9b60f3f4c..48b843d72 100644 --- a/app/controllers/admin/poll/questions/answers/images_controller.rb +++ b/app/controllers/admin/poll/questions/answers/images_controller.rb @@ -16,7 +16,7 @@ class Admin::Poll::Questions::Answers::ImagesController < Admin::Poll::BaseContr if @answer.save redirect_to admin_answer_images_path(@answer), - notice: t("flash.actions.create.poll_question_answer_image") + notice: t("flash.actions.create.poll_question_answer_image") else render :new end diff --git a/app/controllers/admin/poll/questions/answers/videos_controller.rb b/app/controllers/admin/poll/questions/answers/videos_controller.rb index c198540b1..ad613fc41 100644 --- a/app/controllers/admin/poll/questions/answers/videos_controller.rb +++ b/app/controllers/admin/poll/questions/answers/videos_controller.rb @@ -11,7 +11,7 @@ class Admin::Poll::Questions::Answers::VideosController < Admin::Poll::BaseContr def create if @video.save redirect_to admin_answer_videos_path(@answer), - notice: t("flash.actions.create.poll_question_answer_video") + notice: t("flash.actions.create.poll_question_answer_video") else render :new end diff --git a/app/controllers/admin/poll/questions/answers_controller.rb b/app/controllers/admin/poll/questions/answers_controller.rb index 844f3d494..874d99a23 100644 --- a/app/controllers/admin/poll/questions/answers_controller.rb +++ b/app/controllers/admin/poll/questions/answers_controller.rb @@ -12,7 +12,7 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController def create if @answer.save redirect_to admin_question_path(@question), - notice: t("flash.actions.create.poll_question_answer") + notice: t("flash.actions.create.poll_question_answer") else render :new end @@ -24,7 +24,7 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController def update if @answer.update(answer_params) redirect_to admin_question_path(@question), - notice: t("flash.actions.save_changes.notice") + notice: t("flash.actions.save_changes.notice") else render :edit end diff --git a/app/controllers/budgets/investments/votes_controller.rb b/app/controllers/budgets/investments/votes_controller.rb index b48715c5b..29e52a196 100644 --- a/app/controllers/budgets/investments/votes_controller.rb +++ b/app/controllers/budgets/investments/votes_controller.rb @@ -14,7 +14,7 @@ module Budgets respond_to do |format| format.html do redirect_to budget_investments_path(heading_id: @investment.heading.id), - notice: t("flash.actions.create.support") + notice: t("flash.actions.create.support") end format.js { render :show } diff --git a/app/controllers/graphql_controller.rb b/app/controllers/graphql_controller.rb index 877a3a451..0c64ddfb9 100644 --- a/app/controllers/graphql_controller.rb +++ b/app/controllers/graphql_controller.rb @@ -12,7 +12,8 @@ class GraphqlController < ApplicationController begin raise GraphqlController::QueryStringError if query_string.nil? - result = ConsulSchema.execute(query_string, + result = ConsulSchema.execute( + query_string, variables: prepare_variables, context: {}, operation_name: params[:operationName] diff --git a/app/controllers/management/budgets/investments/votes_controller.rb b/app/controllers/management/budgets/investments/votes_controller.rb index 1ab8f8056..c6a013ee6 100644 --- a/app/controllers/management/budgets/investments/votes_controller.rb +++ b/app/controllers/management/budgets/investments/votes_controller.rb @@ -9,7 +9,7 @@ class Management::Budgets::Investments::VotesController < Management::BaseContro respond_to do |format| format.html do redirect_to management_budget_investments_path(heading_id: @investment.heading.id), - notice: t("flash.actions.create.support") + notice: t("flash.actions.create.support") end format.js { render :show } diff --git a/app/helpers/links_helper.rb b/app/helpers/links_helper.rb index 89321462e..0671e9c78 100644 --- a/app/helpers/links_helper.rb +++ b/app/helpers/links_helper.rb @@ -2,7 +2,7 @@ module LinksHelper def render_destroy_element_link(builder, element) link_to_remove_association element.new_record? ? t("links.form.cancel_button") : t("links.form.delete_button"), - builder, class: "delete remove-element" + builder, class: "delete remove-element" end def link_to_signin(options = {}) diff --git a/app/helpers/proposals_dashboard_helper.rb b/app/helpers/proposals_dashboard_helper.rb index d090ca21c..3b069cd02 100644 --- a/app/helpers/proposals_dashboard_helper.rb +++ b/app/helpers/proposals_dashboard_helper.rb @@ -60,10 +60,10 @@ module ProposalsDashboardHelper label = [] label << t("dashboard.resource.required_days", - days: resource.day_offset) if resource.day_offset > 0 + days: resource.day_offset) if resource.day_offset > 0 label << t("dashboard.resource.required_supports", - supports: number_with_delimiter(resource.required_supports, - delimiter: ".")) if resource.required_supports > 0 + supports: number_with_delimiter(resource.required_supports, + delimiter: ".")) if resource.required_supports > 0 safe_join label, h(" #{t("dashboard.resource.and")})") + tag(:br) end diff --git a/app/models/abilities/administrator.rb b/app/models/abilities/administrator.rb index f874af58b..234d3c88b 100644 --- a/app/models/abilities/administrator.rb +++ b/app/models/abilities/administrator.rb @@ -73,7 +73,7 @@ module Abilities can [:hide, :admin_update, :toggle_selection], Budget::Investment can [:valuate, :comment_valuation], Budget::Investment cannot [:admin_update, :toggle_selection, :valuate, :comment_valuation], - Budget::Investment, budget: { phase: "finished" } + Budget::Investment, budget: { phase: "finished" } can :create, Budget::ValuatorAssignment diff --git a/app/models/abilities/common.rb b/app/models/abilities/common.rb index 6c8d6cdd2..2a1432354 100644 --- a/app/models/abilities/common.rb +++ b/app/models/abilities/common.rb @@ -96,9 +96,9 @@ module Abilities can :suggest, Budget::Investment, budget: { phase: "accepting" } can :destroy, Budget::Investment, budget: { phase: ["accepting", "reviewing"] }, author_id: user.id can [:create, :destroy], ActsAsVotable::Vote, - voter_id: user.id, - votable_type: "Budget::Investment", - votable: { budget: { phase: "selecting" }} + voter_id: user.id, + votable_type: "Budget::Investment", + votable: { budget: { phase: "selecting" }} can [:show, :create], Budget::Ballot, budget: { phase: "balloting" } can [:create, :destroy], Budget::Ballot::Line, budget: { phase: "balloting" } diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index f19335baa..34c2ec2eb 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -51,9 +51,9 @@ class Budget has_many :comments, -> { where(valuation: false) }, as: :commentable, inverse_of: :commentable has_one :summary_comment, as: :commentable, class_name: "MlSummaryComment", dependent: :destroy has_many :valuations, -> { where(valuation: true) }, - as: :commentable, - inverse_of: :commentable, - class_name: "Comment" + as: :commentable, + inverse_of: :commentable, + class_name: "Comment" validates_translation :title, presence: true, length: { in: 4..Budget::Investment.title_max_length } validates_translation :description, presence: true, length: { maximum: Budget::Investment.description_max_length } diff --git a/app/models/budget/voting_styles/base.rb b/app/models/budget/voting_styles/base.rb index 86a4b0284..97b220bdd 100644 --- a/app/models/budget/voting_styles/base.rb +++ b/app/models/budget/voting_styles/base.rb @@ -27,8 +27,8 @@ class Budget::VotingStyles::Base def voted_info(heading) I18n.t("budgets.investments.index.sidebar.voted_info.#{name}", - count: investments(heading).count, - amount_spent: budget.formatted_amount(investments_price(heading))) + count: investments(heading).count, + amount_spent: budget.formatted_amount(investments_price(heading))) end def amount_available_info(heading) diff --git a/app/models/concerns/attachable.rb b/app/models/concerns/attachable.rb index 87bd92363..b2bcbf1b4 100644 --- a/app/models/concerns/attachable.rb +++ b/app/models/concerns/attachable.rb @@ -6,25 +6,25 @@ module Attachable attr_accessor :cached_attachment validates :attachment, - presence: true, - file_content_type: { - allow: ->(record) { record.accepted_content_types }, - if: -> { association_class && attachment.attached? }, - message: ->(record, *) do - I18n.t("#{record.model_name.plural}.errors.messages.wrong_content_type", - content_type: record.attachment_content_type, - accepted_content_types: record.class.humanized_accepted_content_types) - end - }, - file_size: { - less_than_or_equal_to: ->(record) { record.max_file_size.megabytes }, - if: -> { association_class && attachment.attached? }, - message: ->(record, *) do - I18n.t("#{record.model_name.plural}.errors.messages.in_between", - min: "0 Bytes", - max: "#{record.max_file_size} MB") - end - } + presence: true, + file_content_type: { + allow: ->(record) { record.accepted_content_types }, + if: -> { association_class && attachment.attached? }, + message: ->(record, *) do + I18n.t("#{record.model_name.plural}.errors.messages.wrong_content_type", + content_type: record.attachment_content_type, + accepted_content_types: record.class.humanized_accepted_content_types) + end + }, + file_size: { + less_than_or_equal_to: ->(record) { record.max_file_size.megabytes }, + if: -> { association_class && attachment.attached? }, + message: ->(record, *) do + I18n.t("#{record.model_name.plural}.errors.messages.in_between", + min: "0 Bytes", + max: "#{record.max_file_size} MB") + end + } before_validation :set_attachment_from_cached_attachment, if: -> { cached_attachment.present? } end diff --git a/app/models/concerns/relationable.rb b/app/models/concerns/relationable.rb index ea73185d7..0d3085117 100644 --- a/app/models/concerns/relationable.rb +++ b/app/models/concerns/relationable.rb @@ -3,9 +3,9 @@ module Relationable included do has_many :related_contents, - as: :parent_relationable, - inverse_of: :parent_relationable, - dependent: :destroy + as: :parent_relationable, + inverse_of: :parent_relationable, + dependent: :destroy end def find_related_content(relationable) diff --git a/app/models/legislation/draft_version.rb b/app/models/legislation/draft_version.rb index a3a7f351a..9b21ae923 100644 --- a/app/models/legislation/draft_version.rb +++ b/app/models/legislation/draft_version.rb @@ -11,9 +11,9 @@ class Legislation::DraftVersion < ApplicationRecord belongs_to :process, foreign_key: "legislation_process_id", inverse_of: :draft_versions has_many :annotations, - foreign_key: "legislation_draft_version_id", - inverse_of: :draft_version, - dependent: :destroy + foreign_key: "legislation_draft_version_id", + inverse_of: :draft_version, + dependent: :destroy validates_translation :title, presence: true validates_translation :body, presence: true diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index 4e42b9a5d..48c41a894 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -27,21 +27,21 @@ class Legislation::Process < ApplicationRecord CSS_HEX_COLOR = /\A#?(?:[A-F0-9]{3}){1,2}\z/i has_many :draft_versions, -> { order(:id) }, - foreign_key: "legislation_process_id", - inverse_of: :process, - dependent: :destroy + foreign_key: "legislation_process_id", + inverse_of: :process, + dependent: :destroy has_one :final_draft_version, -> { where final_version: true, status: "published" }, - class_name: "Legislation::DraftVersion", - foreign_key: "legislation_process_id", - inverse_of: :process + class_name: "Legislation::DraftVersion", + foreign_key: "legislation_process_id", + inverse_of: :process has_many :questions, -> { order(:id) }, - foreign_key: "legislation_process_id", - inverse_of: :process, - dependent: :destroy + foreign_key: "legislation_process_id", + inverse_of: :process, + dependent: :destroy has_many :proposals, -> { order(:id) }, - foreign_key: "legislation_process_id", - inverse_of: :process, - dependent: :destroy + foreign_key: "legislation_process_id", + inverse_of: :process, + dependent: :destroy validates_translation :title, presence: true validates :start_date, presence: true diff --git a/app/models/poll.rb b/app/models/poll.rb index 8317ca3f0..c4eef8d39 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -62,9 +62,11 @@ class Poll < ApplicationRecord end def self.overlaping_with(poll) - where("? < ends_at and ? >= starts_at", poll.starts_at.beginning_of_day, - poll.ends_at.end_of_day).where.not(id: poll.id) - .where(related: poll.related) + where("? < ends_at and ? >= starts_at", + poll.starts_at.beginning_of_day, + poll.ends_at.end_of_day) + .where.not(id: poll.id) + .where(related: poll.related) end def title diff --git a/app/models/poll/question.rb b/app/models/poll/question.rb index 531972f4d..9e043d499 100644 --- a/app/models/poll/question.rb +++ b/app/models/poll/question.rb @@ -15,9 +15,9 @@ class Poll::Question < ApplicationRecord has_many :comments, as: :commentable, inverse_of: :commentable has_many :answers, class_name: "Poll::Answer" has_many :question_answers, -> { order "given_order asc" }, - class_name: "Poll::Question::Answer", - inverse_of: :question, - dependent: :destroy + class_name: "Poll::Question::Answer", + inverse_of: :question, + dependent: :destroy has_many :partial_results belongs_to :proposal diff --git a/app/models/tenant.rb b/app/models/tenant.rb index 5af5af632..36d28b141 100644 --- a/app/models/tenant.rb +++ b/app/models/tenant.rb @@ -2,10 +2,10 @@ class Tenant < ApplicationRecord enum schema_type: %w[subdomain domain] validates :schema, - presence: true, - uniqueness: true, - exclusion: { in: ->(*) { excluded_subdomains }}, - format: { with: URI::DEFAULT_PARSER.regexp[:HOST] } + presence: true, + uniqueness: true, + exclusion: { in: ->(*) { excluded_subdomains }}, + format: { with: URI::DEFAULT_PARSER.regexp[:HOST] } validates :name, presence: true, uniqueness: true after_create :create_schema diff --git a/app/models/user.rb b/app/models/user.rb index 12a78b13c..881ace74e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -26,55 +26,55 @@ class User < ApplicationRecord has_many :proposals, -> { with_hidden }, foreign_key: :author_id, inverse_of: :author has_many :activities has_many :budget_investments, -> { with_hidden }, - class_name: "Budget::Investment", - foreign_key: :author_id, - inverse_of: :author + class_name: "Budget::Investment", + foreign_key: :author_id, + inverse_of: :author has_many :comments, -> { with_hidden }, inverse_of: :user has_many :failed_census_calls has_many :notifications has_many :direct_messages_sent, - class_name: "DirectMessage", - foreign_key: :sender_id, - inverse_of: :sender + class_name: "DirectMessage", + foreign_key: :sender_id, + inverse_of: :sender has_many :direct_messages_received, - class_name: "DirectMessage", - foreign_key: :receiver_id, - inverse_of: :receiver + class_name: "DirectMessage", + foreign_key: :receiver_id, + inverse_of: :receiver has_many :legislation_answers, class_name: "Legislation::Answer", dependent: :destroy, inverse_of: :user has_many :follows has_many :legislation_annotations, - class_name: "Legislation::Annotation", - foreign_key: :author_id, - inverse_of: :author + class_name: "Legislation::Annotation", + foreign_key: :author_id, + inverse_of: :author has_many :legislation_proposals, - class_name: "Legislation::Proposal", - foreign_key: :author_id, - inverse_of: :author + class_name: "Legislation::Proposal", + foreign_key: :author_id, + inverse_of: :author has_many :legislation_questions, - class_name: "Legislation::Question", - foreign_key: :author_id, - inverse_of: :author + class_name: "Legislation::Question", + foreign_key: :author_id, + inverse_of: :author has_many :polls, foreign_key: :author_id, inverse_of: :author has_many :poll_answers, - class_name: "Poll::Answer", - foreign_key: :author_id, - inverse_of: :author + class_name: "Poll::Answer", + foreign_key: :author_id, + inverse_of: :author has_many :poll_pair_answers, - class_name: "Poll::PairAnswer", - foreign_key: :author_id, - inverse_of: :author + class_name: "Poll::PairAnswer", + foreign_key: :author_id, + inverse_of: :author has_many :poll_partial_results, - class_name: "Poll::PartialResult", - foreign_key: :author_id, - inverse_of: :author + class_name: "Poll::PartialResult", + foreign_key: :author_id, + inverse_of: :author has_many :poll_questions, - class_name: "Poll::Question", - foreign_key: :author_id, - inverse_of: :author + class_name: "Poll::Question", + foreign_key: :author_id, + inverse_of: :author has_many :poll_recounts, - class_name: "Poll::Recount", - foreign_key: :author_id, - inverse_of: :author + class_name: "Poll::Recount", + foreign_key: :author_id, + inverse_of: :author has_many :related_contents, foreign_key: :author_id, inverse_of: :author, dependent: nil has_many :topics, foreign_key: :author_id, inverse_of: :author belongs_to :geozone diff --git a/app/models/verification/management/email.rb b/app/models/verification/management/email.rb index 5348c97ba..fbda50b8f 100644 --- a/app/models/verification/management/email.rb +++ b/app/models/verification/management/email.rb @@ -55,8 +55,8 @@ class Verification::Management::Email if document_number_mismatch? errors.add(:email, I18n.t("management.email_verifications.document_mismatch", - document_type: ApplicationController.helpers.humanize_document_type(user.document_type), - document_number: user.document_number)) + document_type: ApplicationController.helpers.humanize_document_type(user.document_type), + document_number: user.document_number)) end end diff --git a/app/views/admin/admin_notifications/index.html.erb b/app/views/admin/admin_notifications/index.html.erb index c8fbe4900..de8b3f392 100644 --- a/app/views/admin/admin_notifications/index.html.erb +++ b/app/views/admin/admin_notifications/index.html.erb @@ -1,6 +1,7 @@

    <%= t("admin.admin_notifications.index.section_title") %>

    -<%= link_to t("admin.admin_notifications.index.new_notification"), new_admin_admin_notification_path, - class: "button float-right" %> +<%= link_to t("admin.admin_notifications.index.new_notification"), + new_admin_admin_notification_path, + class: "button float-right" %> <% if @admin_notifications.any? %> diff --git a/app/views/admin/banners/_form.html.erb b/app/views/admin/banners/_form.html.erb index 8737b760b..cd82e3f37 100644 --- a/app/views/admin/banners/_form.html.erb +++ b/app/views/admin/banners/_form.html.erb @@ -17,12 +17,12 @@ <%= f.translatable_fields do |translations_form| %>
    <%= translations_form.text_field :title, - data: { js_banner_title: "js_banner_title" } %> + data: { js_banner_title: "js_banner_title" } %>
    <%= translations_form.text_field :description, - data: { js_banner_description: "js_banner_description" } %> + data: { js_banner_description: "js_banner_description" } %>
    <% end %> diff --git a/app/views/admin/banners/index.html.erb b/app/views/admin/banners/index.html.erb index a81d0671d..046e7123d 100644 --- a/app/views/admin/banners/index.html.erb +++ b/app/views/admin/banners/index.html.erb @@ -1,5 +1,6 @@ <%= link_to t("admin.banners.index.create"), - new_admin_banner_path, class: "button float-right" %> + new_admin_banner_path, + class: "button float-right" %>

    <%= t("admin.banners.index.title") %>

    diff --git a/app/views/admin/budget_investments/_filters_description.html.erb b/app/views/admin/budget_investments/_filters_description.html.erb index 5732388f8..0aad814fb 100644 --- a/app/views/admin/budget_investments/_filters_description.html.erb +++ b/app/views/admin/budget_investments/_filters_description.html.erb @@ -1,16 +1,16 @@ <% if params[:filter].present? && params[:advanced_filters].present? %>

    <%= sanitize(t("#{i18n_namespace}.filters.two_filters", - filter: t("#{i18n_namespace}.filters.#{params[:filter]}"), - advanced_filters: budget_investments_advanced_filters(params[:advanced_filters]))) %>

    + filter: t("#{i18n_namespace}.filters.#{params[:filter]}"), + advanced_filters: budget_investments_advanced_filters(params[:advanced_filters]))) %>

    <% elsif params[:filter].present? %>

    <%= sanitize(t("#{i18n_namespace}.filters.one_filter", - filter: t("#{i18n_namespace}.filters.#{params[:filter]}"))) %>

    + filter: t("#{i18n_namespace}.filters.#{params[:filter]}"))) %>

    <% elsif params[:advanced_filters].present? %>

    <%= sanitize(t("#{i18n_namespace}.filters.one_filter", - filter: budget_investments_advanced_filters(params[:advanced_filters]))) %>

    + filter: budget_investments_advanced_filters(params[:advanced_filters]))) %>

    <% end %> diff --git a/app/views/admin/budget_investments/_investments.html.erb b/app/views/admin/budget_investments/_investments.html.erb index e5a79becb..f378fd63a 100644 --- a/app/views/admin/budget_investments/_investments.html.erb +++ b/app/views/admin/budget_investments/_investments.html.erb @@ -9,7 +9,8 @@ <% if @investments.any? %>

    <%= page_entries_info @investments %>

    <%= render "admin/shared/columns_selector", - cookie: "investments-columns", default: %w[id title supports admin valuator geozone feasibility price valuation_finished visible_to_valuators selected incompatible] %> + cookie: "investments-columns", + default: %w[id title supports admin valuator geozone feasibility price valuation_finished visible_to_valuators selected incompatible] %>
    <%= render "filters_description", i18n_namespace: "admin.budget_investments.index" %> diff --git a/app/views/admin/budget_investments/_written_by_author.html.erb b/app/views/admin/budget_investments/_written_by_author.html.erb index 63e48d4b6..c7ecf7ea6 100644 --- a/app/views/admin/budget_investments/_written_by_author.html.erb +++ b/app/views/admin/budget_investments/_written_by_author.html.erb @@ -1,8 +1,8 @@
    <%= t "admin.budget_investments.show.info", - budget_name: @budget.name, - group_name: @investment.group.name, - id: @investment.id %> + budget_name: @budget.name, + group_name: @investment.group.name, + id: @investment.id %>

    diff --git a/app/views/admin/budget_investments/edit.html.erb b/app/views/admin/budget_investments/edit.html.erb index e1bed238b..cd4f2f540 100644 --- a/app/views/admin/budget_investments/edit.html.erb +++ b/app/views/admin/budget_investments/edit.html.erb @@ -18,13 +18,13 @@ <%= f.translatable_fields do |translations_form| %>
    <%= translations_form.text_field :title, - maxlength: Budget::Investment.title_max_length %> + maxlength: Budget::Investment.title_max_length %>
    <%= translations_form.text_area :description, - maxlength: Budget::Investment.description_max_length, - class: "html-area" %> + maxlength: Budget::Investment.description_max_length, + class: "html-area" %>
    <% end %> @@ -52,8 +52,8 @@
    <%= f.select(:administrator_id, - @admins.map { |a| [a.description_or_name_and_email, a.id] }, - { include_blank: t("admin.budget_investments.edit.undefined") }) %> + @admins.map { |a| [a.description_or_name_and_email, a.id] }, + { include_blank: t("admin.budget_investments.edit.undefined") }) %>
    @@ -65,10 +65,10 @@ <% end %> <%= f.text_field :valuation_tag_list, - value: @investment.valuation_tag_list.sort.join(","), - label: false, - placeholder: t("admin.budget_investments.edit.tags_placeholder"), - class: "js-tag-list" %> + value: @investment.valuation_tag_list.sort.join(","), + label: false, + placeholder: t("admin.budget_investments.edit.tags_placeholder"), + class: "js-tag-list" %>
    @@ -96,19 +96,19 @@

    <%= t("admin.budget_investments.edit.compatibility") %>

    <%= f.check_box :incompatible, - title: t("admin.budget_investments.edit.compatibility") %> + title: t("admin.budget_investments.edit.compatibility") %>
    <% end %>

    <%= t("admin.budget_investments.edit.selection") %>

    <%= f.check_box :selected, - title: t("admin.budget_investments.edit.selection") %> + title: t("admin.budget_investments.edit.selection") %>
    <%= f.text_field :milestone_tag_list, - value: @investment.milestone_tag_list.sort.join(", ") %> + value: @investment.milestone_tag_list.sort.join(", ") %>
    diff --git a/app/views/admin/dashboard/actions/_form.html.erb b/app/views/admin/dashboard/actions/_form.html.erb index 151af1c54..d98bd9501 100644 --- a/app/views/admin/dashboard/actions/_form.html.erb +++ b/app/views/admin/dashboard/actions/_form.html.erb @@ -5,8 +5,9 @@ <%= f.label :action_type %> <% ::Dashboard::Action.action_types.keys.each do |action_type_value| %> - <%= f.radio_button :action_type, action_type_value, - data: { toggle: "request_to_administrators short_description" } %> + <%= f.radio_button :action_type, + action_type_value, + data: { toggle: "request_to_administrators short_description" } %> <% end %>
    diff --git a/app/views/admin/dashboard/actions/index.html.erb b/app/views/admin/dashboard/actions/index.html.erb index 38b4cba02..544bd5545 100644 --- a/app/views/admin/dashboard/actions/index.html.erb +++ b/app/views/admin/dashboard/actions/index.html.erb @@ -1,5 +1,6 @@ <%= link_to t("admin.dashboard.actions.index.create"), - new_admin_dashboard_action_path, class: "button success float-right" %> + new_admin_dashboard_action_path, + class: "button success float-right" %>

    <%= t("admin.dashboard.actions.index.title") %> diff --git a/app/views/admin/dashboard/administrator_tasks/index.html.erb b/app/views/admin/dashboard/administrator_tasks/index.html.erb index ff30b6d37..ce2dbf6b9 100644 --- a/app/views/admin/dashboard/administrator_tasks/index.html.erb +++ b/app/views/admin/dashboard/administrator_tasks/index.html.erb @@ -25,7 +25,8 @@

    diff --git a/app/views/admin/newsletters/index.html.erb b/app/views/admin/newsletters/index.html.erb index 46270436b..0830c09d8 100644 --- a/app/views/admin/newsletters/index.html.erb +++ b/app/views/admin/newsletters/index.html.erb @@ -1,6 +1,7 @@

    <%= t("admin.newsletters.index.title") %>

    -<%= link_to t("admin.newsletters.index.new_newsletter"), new_admin_newsletter_path, - class: "button float-right" %> +<%= link_to t("admin.newsletters.index.new_newsletter"), + new_admin_newsletter_path, + class: "button float-right" %> <% if @newsletters.any? %>
    <% unless task.executed_at? %> - <%= render Admin::TableActionsComponent.new(task, + <%= render Admin::TableActionsComponent.new( + task, actions: [:edit], edit_text: t("admin.dashboard.administrator_tasks.index.solve") ) %> diff --git a/app/views/admin/emails_download/index.html.erb b/app/views/admin/emails_download/index.html.erb index 395ff9039..3fd0f2f01 100644 --- a/app/views/admin/emails_download/index.html.erb +++ b/app/views/admin/emails_download/index.html.erb @@ -13,7 +13,7 @@ <%= select_tag :users_segment, options_for_select(user_segments_options) %> <%= submit_tag t("admin.emails_download.index.download_emails_button"), - class: "button", - data: { disable_with: false } %> + class: "button", + data: { disable_with: false } %> <% end %> diff --git a/app/views/admin/legislation/draft_versions/_form.html.erb b/app/views/admin/legislation/draft_versions/_form.html.erb index cb56e5ea2..b3f6286a9 100644 --- a/app/views/admin/legislation/draft_versions/_form.html.erb +++ b/app/views/admin/legislation/draft_versions/_form.html.erb @@ -35,8 +35,8 @@
    <%= sanitize(t("admin.legislation.draft_versions.form.title", - draft_version_title: @draft_version.title, - process_title: @process.title)) %> + draft_version_title: @draft_version.title, + process_title: @process.title)) %>
    diff --git a/app/views/admin/legislation/questions/_form.html.erb b/app/views/admin/legislation/questions/_form.html.erb index d0a0e646d..cdab0e727 100644 --- a/app/views/admin/legislation/questions/_form.html.erb +++ b/app/views/admin/legislation/questions/_form.html.erb @@ -29,7 +29,9 @@
    <%= link_to_add_association t("admin.legislation.questions.form.add_option"), - f, :question_options, class: "button hollow" %> + f, + :question_options, + class: "button hollow" %>
    diff --git a/app/views/admin/local_census_records/imports/show.html.erb b/app/views/admin/local_census_records/imports/show.html.erb index ba66a87f8..da64f5900 100644 --- a/app/views/admin/local_census_records/imports/show.html.erb +++ b/app/views/admin/local_census_records/imports/show.html.erb @@ -9,11 +9,11 @@

    <%= t("admin.local_census_records.imports.show.subtitle") %>

    <%= render "local_census_records", - title: t("admin.local_census_records.imports.show.errored"), - id: "invalid-local-census-records", - local_census_records: @import.invalid_records %> + title: t("admin.local_census_records.imports.show.errored"), + id: "invalid-local-census-records", + local_census_records: @import.invalid_records %> <%= render "local_census_records", - title: t("admin.local_census_records.imports.show.created"), - id: "created-local-census-records", - local_census_records: @import.created_records %> + title: t("admin.local_census_records.imports.show.created"), + id: "created-local-census-records", + local_census_records: @import.created_records %> diff --git a/app/views/admin/milestones/_form.html.erb b/app/views/admin/milestones/_form.html.erb index 23314333f..7198f1c93 100644 --- a/app/views/admin/milestones/_form.html.erb +++ b/app/views/admin/milestones/_form.html.erb @@ -5,9 +5,9 @@
    <%= f.select :status_id, - @statuses.map { |s| [s.name, s.id] }, - { include_blank: @statuses.any? ? "" : t("admin.milestones.form.no_statuses_defined") }, - { disabled: @statuses.blank? } %> + @statuses.map { |s| [s.name, s.id] }, + { include_blank: @statuses.any? ? "" : t("admin.milestones.form.no_statuses_defined") }, + { disabled: @statuses.blank? } %> <%= link_to t("admin.milestones.form.admin_statuses"), admin_milestone_statuses_path %>
    diff --git a/app/views/admin/milestones/_milestones.html.erb b/app/views/admin/milestones/_milestones.html.erb index 43479ce86..46940ab88 100644 --- a/app/views/admin/milestones/_milestones.html.erb +++ b/app/views/admin/milestones/_milestones.html.erb @@ -47,9 +47,9 @@ <% if milestone.documents.present? %> <% milestone.documents.each do |document| %> <%= link_to document.title, - document.attachment, - target: "_blank", - rel: "nofollow" %>
    + document.attachment, + target: "_blank", + rel: "nofollow" %>
    <% end %> <% end %>
    diff --git a/app/views/admin/newsletters/new.html.erb b/app/views/admin/newsletters/new.html.erb index b600bdd89..2c05aed24 100644 --- a/app/views/admin/newsletters/new.html.erb +++ b/app/views/admin/newsletters/new.html.erb @@ -3,8 +3,8 @@

    <%= t("admin.newsletters.new.title") %>

    <%= sanitize(t("admin.newsletters.new.header_footer_help_text", - link: link_to(t("admin.newsletters.new.image_link"), - admin_site_customization_images_path))) %> + link: link_to(t("admin.newsletters.new.image_link"), + admin_site_customization_images_path))) %>

    <%= render "form" %> diff --git a/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb b/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb index 3da870b1f..83a68746f 100644 --- a/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb +++ b/app/views/admin/poll/booth_assignments/_booth_assignment.html.erb @@ -12,7 +12,8 @@ <% end %> diff --git a/app/views/dashboard/polls/_form.html.erb b/app/views/dashboard/polls/_form.html.erb index 6a74ad95c..d39a8070b 100644 --- a/app/views/dashboard/polls/_form.html.erb +++ b/app/views/dashboard/polls/_form.html.erb @@ -8,16 +8,16 @@
    <%= f.text_field :starts_at, - autocomplete: "off", - value: poll.starts_at.present? ? l(poll.starts_at.to_date) : nil, - class: "js-calendar-full" %> + autocomplete: "off", + value: poll.starts_at.present? ? l(poll.starts_at.to_date) : nil, + class: "js-calendar-full" %>
    <%= f.text_field :ends_at, - autocomplete: "off", - value: poll.ends_at.present? ? l(poll.ends_at.to_date) : nil, - class: "js-calendar-full" %> + autocomplete: "off", + value: poll.ends_at.present? ? l(poll.ends_at.to_date) : nil, + class: "js-calendar-full" %>
    diff --git a/app/views/debates/_actions.html.erb b/app/views/debates/_actions.html.erb index 3605d3fcf..d3e64148b 100644 --- a/app/views/debates/_actions.html.erb +++ b/app/views/debates/_actions.html.erb @@ -4,9 +4,15 @@  |  <% if debate.featured? %> <%= link_to t("admin.actions.unmark_featured").capitalize, unmark_featured_debate_path(debate), - method: :put, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.unmark_featured"), name: debate.title) } %> + method: :put, + data: { confirm: t("admin.actions.confirm_action", + action: t("admin.actions.unmark_featured"), + name: debate.title) } %> <% else %> <%= link_to t("admin.actions.mark_featured").capitalize, mark_featured_debate_path(debate), - method: :put, data: { confirm: t("admin.actions.confirm_action", action: t("admin.actions.mark_featured"), name: debate.title) } %> + method: :put, + data: { confirm: t("admin.actions.confirm_action", + action: t("admin.actions.mark_featured"), + name: debate.title) } %> <% end %> <% end %> diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index 08647fee1..6e51a2b5e 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -69,7 +69,7 @@

    <%= t("debates.index.section_footer.description") %>

    <%= t("debates.index.section_footer.help_text_1") %>

    <%= sanitize(t("debates.index.section_footer.help_text_2", - org: link_to(setting["org_name"], new_user_registration_path))) %>

    + org: link_to(setting["org_name"], new_user_registration_path))) %>

    <% end %> diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index 52f6dd160..52146ee68 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -60,11 +60,11 @@ <%= render "debates/votes", debate: @debate %> <%= render "shared/social_share", - share_title: t("debates.show.share"), - title: @debate.title, - url: debate_url(@debate), - description: @debate.title, - mobile: @debate.title %> + share_title: t("debates.show.share"), + title: @debate.title, + url: debate_url(@debate), + description: @debate.title, + mobile: @debate.title %> diff --git a/app/views/devise/confirmations/show.html.erb b/app/views/devise/confirmations/show.html.erb index b6c7d5729..4024802a2 100644 --- a/app/views/devise/confirmations/show.html.erb +++ b/app/views/devise/confirmations/show.html.erb @@ -15,12 +15,12 @@
    <%= f.password_field :password, - autofocus: true, - label: t("devise_views.confirmations.show.new_password_label") %> + autofocus: true, + label: t("devise_views.confirmations.show.new_password_label") %>
    <%= f.password_field :password_confirmation, - label: t("devise_views.confirmations.show.new_password_confirmation_label") %> + label: t("devise_views.confirmations.show.new_password_confirmation_label") %>
    diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 0ed59c5ca..968d64321 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -5,7 +5,7 @@

    <%= sanitize(t("devise_views.shared.links.signup", - signup_link: link_to(t("devise_views.shared.links.signup_link"), new_user_registration_path))) %> + signup_link: link_to(t("devise_views.shared.links.signup_link"), new_user_registration_path))) %>

    <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> diff --git a/app/views/direct_messages/new.html.erb b/app/views/direct_messages/new.html.erb index 8c0635a26..1343f6363 100644 --- a/app/views/direct_messages/new.html.erb +++ b/app/views/direct_messages/new.html.erb @@ -10,7 +10,8 @@

    <%= sanitize(t("users.login_to_continue", - signin: link_to_signin, signup: link_to_signup)) %> + signin: link_to_signin, + signup: link_to_signup)) %>

    <% elsif not @receiver.email_on_direct_message? %> @@ -34,7 +35,7 @@

    <%= sanitize(t("users.direct_messages.new.verified_only", - verify_account: link_to_verify_account)) %> + verify_account: link_to_verify_account)) %>

    <% end %> diff --git a/app/views/direct_messages/show.html.erb b/app/views/direct_messages/show.html.erb index 7a3ce847a..7ee6abb87 100644 --- a/app/views/direct_messages/show.html.erb +++ b/app/views/direct_messages/show.html.erb @@ -6,7 +6,7 @@
    <%= t("users.direct_messages.show.receiver", - receiver: @direct_message.receiver.name) %> + receiver: @direct_message.receiver.name) %>

    <%= @direct_message.title %>

    diff --git a/app/views/documents/_document.html.erb b/app/views/documents/_document.html.erb index 5f6b52378..a2a244933 100644 --- a/app/views/documents/_document.html.erb +++ b/app/views/documents/_document.html.erb @@ -15,9 +15,9 @@ <% if can?(:destroy, document) %>
    <%= link_to t("documents.buttons.destroy_document"), - document, - method: :delete, - data: { confirm: t("documents.actions.destroy.confirm") }, - class: "delete" %> + document, + method: :delete, + data: { confirm: t("documents.actions.destroy.confirm") }, + class: "delete" %> <% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 1f7e0e617..eb84e2688 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,9 +5,9 @@ <%= render "layouts/meta_tags" %> <%= content_for :canonical %> <%= favicon_link_tag image_path_for("apple-touch-icon-200.png"), - rel: "icon apple-touch-icon", - sizes: "200x200", - type: "image/png" %> + rel: "icon apple-touch-icon", + sizes: "200x200", + type: "image/png" %> <%= content_for :social_media_meta_tags %> <%= raw setting["html.per_page_code_head"] %> @@ -28,10 +28,14 @@

    <%= t("layouts.application.ie_title") %>

    <%= sanitize(t("layouts.application.ie", - chrome: link_to( - t("layouts.application.chrome"), "https://www.google.com/chrome/browser/desktop/", title: t("shared.target_blank"), target: "_blank"), - firefox: link_to( - t("layouts.application.firefox"), "https://www.mozilla.org/firefox", title: t("shared.target_blank"), target: "_blank") + chrome: link_to(t("layouts.application.chrome"), + "https://www.google.com/chrome/browser/desktop/", + title: t("shared.target_blank"), + target: "_blank"), + firefox: link_to(t("layouts.application.firefox"), + "https://www.mozilla.org/firefox", + title: t("shared.target_blank"), + target: "_blank") )) %>

    diff --git a/app/views/layouts/dashboard.html.erb b/app/views/layouts/dashboard.html.erb index ffdfc9439..77f42bdcc 100644 --- a/app/views/layouts/dashboard.html.erb +++ b/app/views/layouts/dashboard.html.erb @@ -5,9 +5,9 @@ <%= render "layouts/meta_tags" %> <%= content_for :canonical %> <%= favicon_link_tag image_path_for("apple-touch-icon-200.png"), - rel: "icon apple-touch-icon", - sizes: "200x200", - type: "image/png" %> + rel: "icon apple-touch-icon", + sizes: "200x200", + type: "image/png" %> <%= content_for :social_media_meta_tags %> <%= raw setting["per_page_code_head"] %> diff --git a/app/views/legislation/annotations/_comments_box.html.erb b/app/views/legislation/annotations/_comments_box.html.erb index c33429e07..8b06813d9 100644 --- a/app/views/legislation/annotations/_comments_box.html.erb +++ b/app/views/legislation/annotations/_comments_box.html.erb @@ -23,10 +23,10 @@ diff --git a/app/views/legislation/draft_versions/show.html.erb b/app/views/legislation/draft_versions/show.html.erb index f4f1ad0ed..e42bb0920 100644 --- a/app/views/legislation/draft_versions/show.html.erb +++ b/app/views/legislation/draft_versions/show.html.erb @@ -25,7 +25,7 @@ <% end %> <%= t("legislation.draft_versions.show.updated_at", - date: format_date(@draft_version.updated_at)) %> + date: format_date(@draft_version.updated_at)) %> <% unless @draft_version.final_version? %> diff --git a/app/views/legislation/processes/_header.html.erb b/app/views/legislation/processes/_header.html.erb index eb05108a5..0e38798d8 100644 --- a/app/views/legislation/processes/_header.html.erb +++ b/app/views/legislation/processes/_header.html.erb @@ -3,9 +3,10 @@
    <% if banner_color? %> - <%= link_to t("shared.back"), legislation_processes_path, - class: "icon-angle-left", - style: "color:#{process.font_color};" %> + <%= link_to t("shared.back"), + legislation_processes_path, + class: "icon-angle-left", + style: "color:#{process.font_color};" %> <% else %> <%= back_link_to legislation_processes_path %> <% end %> @@ -37,11 +38,11 @@
    <%= render "shared/social_share", - share_title: t("proposals.show.share"), - title: @proposal.title, - url: legislation_process_proposal_url(process_id: @process), - description: @proposal.summary, - mobile: @proposal.title %> + share_title: t("proposals.show.share"), + title: @proposal.title, + url: legislation_process_proposal_url(process_id: @process), + description: @proposal.summary, + mobile: @proposal.title %> diff --git a/app/views/legislation/questions/_participation_not_allowed.html.erb b/app/views/legislation/questions/_participation_not_allowed.html.erb index 4e72372bb..35d6f351c 100644 --- a/app/views/legislation/questions/_participation_not_allowed.html.erb +++ b/app/views/legislation/questions/_participation_not_allowed.html.erb @@ -8,13 +8,14 @@

    <%= sanitize(t("legislation.questions.participation.verified_only", - verify_account: link_to_verify_account)) %> + verify_account: link_to_verify_account)) %>

    <% elsif !user_signed_in? %>
    <%= sanitize(t("legislation.questions.participation.unauthenticated", - signin: link_to_signin, signup: link_to_signup)) %> + signin: link_to_signin, + signup: link_to_signup)) %>
    <% elsif !@process.debate_phase.open? %>
    diff --git a/app/views/mailer/budget_investment_created.html.erb b/app/views/mailer/budget_investment_created.html.erb index 8c2da30c6..12f945b41 100644 --- a/app/views/mailer/budget_investment_created.html.erb +++ b/app/views/mailer/budget_investment_created.html.erb @@ -21,8 +21,9 @@

    <%= sanitize( t("mailers.budget_investment_created.follow", - link: link_to(t("mailers.budget_investment_created.follow_link"), budgets_url, - style: css_for_mailer_link) + link: link_to(t("mailers.budget_investment_created.follow_link"), + budgets_url, + style: css_for_mailer_link) ), attributes: %w[href style] ) %> diff --git a/app/views/mailer/direct_message_for_receiver.html.erb b/app/views/mailer/direct_message_for_receiver.html.erb index efe41e744..33c64f941 100644 --- a/app/views/mailer/direct_message_for_receiver.html.erb +++ b/app/views/mailer/direct_message_for_receiver.html.erb @@ -13,7 +13,7 @@

    diff --git a/app/views/mailer/user_invite.html.erb b/app/views/mailer/user_invite.html.erb index aa435ec9d..0b5151fb3 100644 --- a/app/views/mailer/user_invite.html.erb +++ b/app/views/mailer/user_invite.html.erb @@ -1,12 +1,10 @@ + officing_poll_ballot_sheet_path(@poll.id, ballot_sheet.id) %> diff --git a/app/views/officing/ballot_sheets/new.html.erb b/app/views/officing/ballot_sheets/new.html.erb index 4fbc871ca..c4a159a1f 100644 --- a/app/views/officing/ballot_sheets/new.html.erb +++ b/app/views/officing/ballot_sheets/new.html.erb @@ -4,8 +4,8 @@ <%= form_tag(officing_poll_ballot_sheets_path(@poll)) do %> <%= label_tag :officer_assignment_id, t("officing.poll_budgets.new.booth") %> <%= select_tag :officer_assignment_id, - booths_for_officer_select_options(@officer_assignments), - { prompt: t("officing.poll_budgets.new.select_booth") } %> + booths_for_officer_select_options(@officer_assignments), + { prompt: t("officing.poll_budgets.new.select_booth") } %> <%= label_tag :data, t("officing.poll_budgets.new.csv_data") %> <%= text_area_tag :data, nil, rows: 10 %> diff --git a/app/views/officing/results/new.html.erb b/app/views/officing/results/new.html.erb index 9b2855133..06f49a251 100644 --- a/app/views/officing/results/new.html.erb +++ b/app/views/officing/results/new.html.erb @@ -6,8 +6,8 @@
    <%= select_tag :officer_assignment_id, - booths_for_officer_select_options(@officer_assignments), - { prompt: t("officing.results.new.select_booth") } %> + booths_for_officer_select_options(@officer_assignments), + { prompt: t("officing.results.new.select_booth") } %>
    diff --git a/app/views/organizations/registrations/new.html.erb b/app/views/organizations/registrations/new.html.erb index 1b5bfbd12..09b462f6d 100644 --- a/app/views/organizations/registrations/new.html.erb +++ b/app/views/organizations/registrations/new.html.erb @@ -9,8 +9,8 @@ <%= f.fields_for :organization do |fo| %> <%= fo.text_field :name, autofocus: true, maxlength: Organization.name_max_length %> <%= fo.text_field :responsible_name, - maxlength: Organization.responsible_name_max_length, - hint: t("devise_views.organizations.registrations.new.responsible_name_note") %> + maxlength: Organization.responsible_name_max_length, + hint: t("devise_views.organizations.registrations.new.responsible_name_note") %> <% end %> <%= f.email_field :email %> @@ -25,13 +25,13 @@ label: t("devise_views.organizations.registrations.new.password_confirmation_label") %> <%= f.check_box :terms_of_service, - title: t("devise_views.users.registrations.new.terms_title"), - label: t("devise_views.users.registrations.new.terms", - terms: link_to(t("devise_views.users.registrations.new.terms_link"), - "/conditions", - title: t("shared.target_blank"), - target: "_blank") - ) %> + title: t("devise_views.users.registrations.new.terms_title"), + label: t("devise_views.users.registrations.new.terms", + terms: link_to(t("devise_views.users.registrations.new.terms_link"), + "/conditions", + title: t("shared.target_blank"), + target: "_blank") + ) %>
    <%= f.submit t("devise_views.organizations.registrations.new.submit"), class: "button expanded" %> diff --git a/app/views/organizations/registrations/success.html.erb b/app/views/organizations/registrations/success.html.erb index e4425b53a..252c2ee7f 100644 --- a/app/views/organizations/registrations/success.html.erb +++ b/app/views/organizations/registrations/success.html.erb @@ -5,5 +5,6 @@

    <%= t("devise_views.organizations.registrations.success.instructions_3") %>

    <%= link_to t("devise_views.organizations.registrations.success.back_to_index"), - root_path, class: "button margin-top expanded" %> + root_path, + class: "button margin-top expanded" %>

    diff --git a/app/views/pages/help/_budgets.html.erb b/app/views/pages/help/_budgets.html.erb index 21d8c53d0..8712d9708 100644 --- a/app/views/pages/help/_budgets.html.erb +++ b/app/views/pages/help/_budgets.html.erb @@ -1,6 +1,6 @@ <%= render Pages::Help::SectionComponent.new("budgets") do %>

    <%= sanitize(t("pages.help.budgets.description", - link: link_to(t("pages.help.budgets.link"), budgets_path))) %> + link: link_to(t("pages.help.budgets.link"), budgets_path))) %>

    <% end %> diff --git a/app/views/pages/help/_debates.html.erb b/app/views/pages/help/_debates.html.erb index db380a20e..262e2bb8b 100644 --- a/app/views/pages/help/_debates.html.erb +++ b/app/views/pages/help/_debates.html.erb @@ -1,14 +1,14 @@ <%= render Pages::Help::SectionComponent.new("debates") do %>

    <%= sanitize(t("pages.help.debates.description", - org: setting["org_name"], - link: link_to(t("pages.help.debates.link"), debates_path))) %> + org: setting["org_name"], + link: link_to(t("pages.help.debates.link"), debates_path))) %>

    • <%= sanitize(t("pages.help.debates.feature", - link: link_to(t("pages.help.debates.feature_link", org: setting["org_name"]), - new_user_registration_path))) %> + link: link_to(t("pages.help.debates.feature_link", org: setting["org_name"]), + new_user_registration_path))) %>
    <% end %> diff --git a/app/views/pages/help/_polls.html.erb b/app/views/pages/help/_polls.html.erb index c7d1dd40c..f135c38c8 100644 --- a/app/views/pages/help/_polls.html.erb +++ b/app/views/pages/help/_polls.html.erb @@ -1,13 +1,13 @@ <%= render Pages::Help::SectionComponent.new("polls") do %>

    <%= sanitize(t("pages.help.polls.description", - link: link_to(t("pages.help.polls.link"), polls_path))) %> + link: link_to(t("pages.help.polls.link"), polls_path))) %>

    • <%= sanitize(t("pages.help.polls.feature_1", - link: link_to(t("pages.help.polls.feature_1_link", org_name: setting["org_name"]), - new_user_registration_path))) %> + link: link_to(t("pages.help.polls.feature_1_link", org_name: setting["org_name"]), + new_user_registration_path))) %>
    <% end %> diff --git a/app/views/pages/help/_processes.html.erb b/app/views/pages/help/_processes.html.erb index 18178f385..38352e135 100644 --- a/app/views/pages/help/_processes.html.erb +++ b/app/views/pages/help/_processes.html.erb @@ -6,8 +6,8 @@
    • <%= sanitize(t("pages.help.processes.feature", - link: link_to(t("pages.help.processes.feature_link", org_name: setting["org_name"]), - new_user_registration_path))) %> + link: link_to(t("pages.help.processes.feature_link", org_name: setting["org_name"]), + new_user_registration_path))) %>
    <% end %> diff --git a/app/views/pages/help/_proposals.html.erb b/app/views/pages/help/_proposals.html.erb index ef6875e67..9a8634eb9 100644 --- a/app/views/pages/help/_proposals.html.erb +++ b/app/views/pages/help/_proposals.html.erb @@ -1,6 +1,6 @@ <%= render Pages::Help::SectionComponent.new("proposals") do %>

    <%= sanitize(t("pages.help.proposals.description", - link: link_to(t("pages.help.proposals.link"), proposals_path))) %> + link: link_to(t("pages.help.proposals.link"), proposals_path))) %>

    <% end %> diff --git a/app/views/polls/_callout.html.erb b/app/views/polls/_callout.html.erb index 5a837d0e3..432d8c984 100644 --- a/app/views/polls/_callout.html.erb +++ b/app/views/polls/_callout.html.erb @@ -2,13 +2,13 @@ <% if current_user.nil? %>
    <%= sanitize(t("polls.show.cant_answer_not_logged_in", - signin: link_to_signin(class: "probe-message"), - signup: link_to_signup(class: "probe-message"))) %> + signin: link_to_signin(class: "probe-message"), + signup: link_to_signup(class: "probe-message"))) %>
    <% elsif current_user.unverified? %>
    <%= sanitize(t("polls.show.cant_answer_verify", - verify_link: link_to(t("polls.show.verify_link"), verification_path))) %> + verify_link: link_to(t("polls.show.verify_link"), verification_path))) %>
    <% elsif @poll.expired? %>
    diff --git a/app/views/polls/_poll_header.html.erb b/app/views/polls/_poll_header.html.erb index 77e95679d..73cd608db 100644 --- a/app/views/polls/_poll_header.html.erb +++ b/app/views/polls/_poll_header.html.erb @@ -23,11 +23,11 @@
    diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index c88a7ce0a..3d9d88494 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -2,11 +2,11 @@ <%= provide :meta_description, t("social_share.polls_show.description_#{@poll.id}", default: @poll.title) %> <%= provide :social_media_meta_tags do %> <%= render "shared/social_media_meta_tags", - social_url: poll_url, - social_title: t("social_share.polls_show.title_#{@poll.id}", default: @poll.title), - social_description: t("social_share.polls_show.facebook_#{@poll.id}", default: @poll.title), - twitter_image_url: "social_media_polls_twitter.jpg", - og_image_url: "social_media_polls.jpg" %> + social_url: poll_url, + social_title: t("social_share.polls_show.title_#{@poll.id}", default: @poll.title), + social_description: t("social_share.polls_show.facebook_#{@poll.id}", default: @poll.title), + twitter_image_url: "social_media_polls_twitter.jpg", + og_image_url: "social_media_polls.jpg" %> <% end %>
    diff --git a/app/views/proposal_notifications/new.html.erb b/app/views/proposal_notifications/new.html.erb index 7089e7f49..9075def3a 100644 --- a/app/views/proposal_notifications/new.html.erb +++ b/app/views/proposal_notifications/new.html.erb @@ -7,9 +7,9 @@

    <%= sanitize(t("proposal_notifications.new.info_about_receivers", - count: @proposal.users_to_notify.count, - proposal_page: link_to(t("proposal_notifications.new.proposal_page"), - proposal_path(@proposal, anchor: "comments")))) %> + count: @proposal.users_to_notify.count, + proposal_page: link_to(t("proposal_notifications.new.proposal_page"), + proposal_path(@proposal, anchor: "comments")))) %>

    diff --git a/app/views/proposals/_info.html.erb b/app/views/proposals/_info.html.erb index 71060a514..ec5d2b866 100644 --- a/app/views/proposals/_info.html.erb +++ b/app/views/proposals/_info.html.erb @@ -68,8 +68,8 @@ <% if feature?(:allow_attached_documents) %> <%= render "documents/documents", - documents: @proposal.documents, - max_documents_allowed: Proposal.max_documents_allowed %> + documents: @proposal.documents, + max_documents_allowed: Proposal.max_documents_allowed %> <% end %> <%= render "shared/tags", taggable: @proposal %> diff --git a/app/views/proposals/_social_share.html.erb b/app/views/proposals/_social_share.html.erb index fedfa587a..2dcc2ffde 100644 --- a/app/views/proposals/_social_share.html.erb +++ b/app/views/proposals/_social_share.html.erb @@ -1,10 +1,10 @@ <%= render "shared/social_share", - share_title: share_title, - title: proposal.title, - url: proposal_url(proposal), - description: t("proposals.share.message", - title: proposal.title, - handle: setting["org_name"]), - mobile: t("proposals.share.message", - title: proposal.title, - handle: setting["twitter_handle"]) %> + share_title: share_title, + title: proposal.title, + url: proposal_url(proposal), + description: t("proposals.share.message", + title: proposal.title, + handle: setting["org_name"]), + mobile: t("proposals.share.message", + title: proposal.title, + handle: setting["twitter_handle"]) %> diff --git a/app/views/proposals/_supports.html.erb b/app/views/proposals/_supports.html.erb index 2ff839593..e58d353a4 100644 --- a/app/views/proposals/_supports.html.erb +++ b/app/views/proposals/_supports.html.erb @@ -10,7 +10,7 @@ "> <%= t("proposals.proposal.supports_necessary", - number: number_with_delimiter(Proposal.votes_needed_for_success)) %> + number: number_with_delimiter(Proposal.votes_needed_for_success)) %> diff --git a/app/views/proposals/retire_form.html.erb b/app/views/proposals/retire_form.html.erb index 4fb65cb3e..e22d80255 100644 --- a/app/views/proposals/retire_form.html.erb +++ b/app/views/proposals/retire_form.html.erb @@ -16,8 +16,9 @@ <%= render "shared/errors", resource: @proposal %>
    - <%= f.select :retired_reason, retire_proposals_options, - include_blank: t("proposals.retire_form.retired_reason_blank") %> + <%= f.select :retired_reason, + retire_proposals_options, + include_blank: t("proposals.retire_form.retired_reason_blank") %>
    @@ -25,8 +26,9 @@ <%= f.translatable_fields do |translations_form| %>
    <%= translations_form.text_area :retired_explanation, - rows: 4, maxlength: 500, - placeholder: t("proposals.retire_form.retired_explanation_placeholder") %> + rows: 4, + maxlength: 500, + placeholder: t("proposals.retire_form.retired_explanation_placeholder") %>
    <% end %> diff --git a/app/views/proposals/share.html.erb b/app/views/proposals/share.html.erb index 1ee1938de..26e2453a6 100644 --- a/app/views/proposals/share.html.erb +++ b/app/views/proposals/share.html.erb @@ -1,9 +1,9 @@ <% provide :title do %><%= @proposal.title %><% end %> <% provide :social_media_meta_tags do %> <%= render "shared/social_media_meta_tags", - social_url: proposal_url(@proposal), - social_title: @proposal.title, - social_description: @proposal.summary %> + social_url: proposal_url(@proposal), + social_title: @proposal.title, + social_description: @proposal.summary %> <% end %> <% content_for :canonical do %> <%= render "shared/canonical", href: proposal_url(@proposal) %> @@ -25,10 +25,10 @@

    <%= render "shared/social_share", - title: @proposal.title, - url: proposal_url(@proposal), - description: @proposal.summary, - mobile: @proposal.title %> + title: @proposal.title, + url: proposal_url(@proposal), + description: @proposal.summary, + mobile: @proposal.title %> <% if can?(:dashboard, @proposal) %>
    diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index ea2c5e844..d3dafbc8f 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -3,11 +3,11 @@ <% content_for :meta_description do %><%= @proposal.summary %><% end %> <% provide :social_media_meta_tags do %> <%= render "shared/social_media_meta_tags", - social_url: proposal_url(@proposal), - social_title: @proposal.title, - social_description: @proposal.summary, - twitter_image_url: (@proposal.image.present? ? polymorphic_path(@proposal.image.variant(:thumb)) : nil), - og_image_url: (@proposal.image.present? ? polymorphic_path(@proposal.image.variant(:thumb)) : nil) %> + social_url: proposal_url(@proposal), + social_title: @proposal.title, + social_description: @proposal.summary, + twitter_image_url: (@proposal.image.present? ? polymorphic_path(@proposal.image.variant(:thumb)) : nil), + og_image_url: (@proposal.image.present? ? polymorphic_path(@proposal.image.variant(:thumb)) : nil) %> <% end %> <% content_for :canonical do %> <%= render "shared/canonical", href: proposal_url(@proposal) %> diff --git a/app/views/relationable/_form.html.erb b/app/views/relationable/_form.html.erb index 4f2def3aa..44d22d44c 100644 --- a/app/views/relationable/_form.html.erb +++ b/app/views/relationable/_form.html.erb @@ -12,8 +12,8 @@
    <%= text_field_tag :url, "", - "aria-describedby": "related_content_help_text", - placeholder: t("related_content.placeholder", url: root_url) %> + "aria-describedby": "related_content_help_text", + placeholder: t("related_content.placeholder", url: root_url) %> <%= hidden_field_tag :relationable_klass, relationable.class.name %> <%= hidden_field_tag :relationable_id, relationable.id %> diff --git a/app/views/shared/_filter_subnav.html.erb b/app/views/shared/_filter_subnav.html.erb index fc4c5a950..ab9161ef6 100644 --- a/app/views/shared/_filter_subnav.html.erb +++ b/app/views/shared/_filter_subnav.html.erb @@ -6,7 +6,7 @@
  • <%= t("#{i18n_namespace}.filters.#{filter}") %>

  • <% else %>
  • <%= link_to t("#{i18n_namespace}.filters.#{filter}"), - current_path_with_query_params(filter: filter, page: 1) %>
  • + current_path_with_query_params(filter: filter, page: 1) %> <% end %> <% end %> diff --git a/app/views/shared/_filter_subnav_vertical.html.erb b/app/views/shared/_filter_subnav_vertical.html.erb index e1af05ef5..c4d6ae084 100644 --- a/app/views/shared/_filter_subnav_vertical.html.erb +++ b/app/views/shared/_filter_subnav_vertical.html.erb @@ -8,7 +8,7 @@ <% else %>
  • <%= link_to t("#{i18n_namespace}.filters.#{filter}"), - current_path_with_query_params(filter: filter, page: 1) %>
  • + current_path_with_query_params(filter: filter, page: 1) %> <% end %> <% end %> diff --git a/app/views/shared/_globalize_locales.html.erb b/app/views/shared/_globalize_locales.html.erb index 38464ac3b..88aa4064b 100644 --- a/app/views/shared/_globalize_locales.html.erb +++ b/app/views/shared/_globalize_locales.html.erb @@ -1,6 +1,6 @@ <% if translations_interface_enabled? %> <%= render "shared/common_globalize_locales", - resource: resource, - display_style: lambda { |locale| enable_translation_style(resource, locale) }, - manage_languages: defined?(manage_languages) ? manage_languages : true %> + resource: resource, + display_style: lambda { |locale| enable_translation_style(resource, locale) }, + manage_languages: defined?(manage_languages) ? manage_languages : true %> <% end %> diff --git a/app/views/shared/_suggest.html.erb b/app/views/shared/_suggest.html.erb index 4bdeb6319..ad88e9174 100644 --- a/app/views/shared/_suggest.html.erb +++ b/app/views/shared/_suggest.html.erb @@ -4,8 +4,8 @@

    <%= t("shared.suggest.#{resource_name}.found", - count: @resources.count, - query: @search_terms) %> + count: @resources.count, + query: @search_terms) %>

    @@ -19,9 +19,9 @@

    <%= t("shared.suggest.#{resource_name}.message", - count: @resources.count, - query: @search_terms, - limit: @limit) %> + count: @resources.count, + query: @search_terms, + limit: @limit) %> <%= link_to t("shared.suggest.#{resource_name}.see_all"), polymorphic_path(resource_model, search: @search_terms) %> diff --git a/app/views/topics/_informative_text.html.erb b/app/views/topics/_informative_text.html.erb index 43604a623..599a84436 100644 --- a/app/views/topics/_informative_text.html.erb +++ b/app/views/topics/_informative_text.html.erb @@ -7,6 +7,7 @@ <% else %>

    <%= sanitize(t("community.show.create_first_community_topic.sub_first_theme", - sign_in: link_to_signin, sign_up: link_to_signup)) %> + sign_in: link_to_signin, + sign_up: link_to_signup)) %>
    <% end %> diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index 318904a72..767d94efa 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -2,9 +2,10 @@
    - <%= back_link_to community_path(@community), t("community.show.back", - community: community_text(@community), - proposal: community_title(@community)) %> + <%= back_link_to community_path(@community), + t("community.show.back", + community: community_text(@community), + proposal: community_title(@community)) %>

    <%= @topic.title %>

    diff --git a/app/views/users/registrations/delete_form.html.erb b/app/views/users/registrations/delete_form.html.erb index c3b19fe01..1e8ba16e1 100644 --- a/app/views/users/registrations/delete_form.html.erb +++ b/app/views/users/registrations/delete_form.html.erb @@ -15,8 +15,8 @@

    <%= f.text_field :erase_reason, - autofocus: true, - label: t("devise_views.users.registrations.delete_form.erase_reason_label") %> + autofocus: true, + label: t("devise_views.users.registrations.delete_form.erase_reason_label") %> <%= f.submit t("devise_views.users.registrations.delete_form.submit"), class: "button alert expanded" %> <% end %> diff --git a/app/views/users/registrations/edit.html.erb b/app/views/users/registrations/edit.html.erb index 28bff0014..8750fd963 100644 --- a/app/views/users/registrations/edit.html.erb +++ b/app/views/users/registrations/edit.html.erb @@ -7,8 +7,8 @@
    <%= f.email_field :email, - label: t("devise_views.users.registrations.edit.email_label"), - autofocus: true %> + label: t("devise_views.users.registrations.edit.email_label"), + autofocus: true %>
    @@ -19,22 +19,22 @@
    <%= f.password_field :password, - autocomplete: "off", - label: t("devise_views.users.registrations.edit.password_label"), - hint: t("devise_views.users.registrations.edit.leave_blank") %> + autocomplete: "off", + label: t("devise_views.users.registrations.edit.password_label"), + hint: t("devise_views.users.registrations.edit.leave_blank") %>
    <%= f.password_field :password_confirmation, - label: t("devise_views.users.registrations.edit.password_confirmation_label"), - autocomplete: "off" %> + label: t("devise_views.users.registrations.edit.password_confirmation_label"), + autocomplete: "off" %>
    <%= f.password_field :current_password, - label: t("devise_views.users.registrations.edit.current_password_label"), - autocomplete: "off", - hint: t("devise_views.users.registrations.edit.need_current") %> + label: t("devise_views.users.registrations.edit.current_password_label"), + autocomplete: "off", + hint: t("devise_views.users.registrations.edit.need_current") %>
    diff --git a/app/views/users/registrations/new.html.erb b/app/views/users/registrations/new.html.erb index a8b0e83b5..6f028e199 100644 --- a/app/views/users/registrations/new.html.erb +++ b/app/views/users/registrations/new.html.erb @@ -8,7 +8,8 @@

    <%= sanitize(t("devise_views.users.registrations.new.organization_signup", - signup_link: link_to(t("devise_views.users.registrations.new.organization_signup_link"), new_organization_registration_path))) %> + signup_link: link_to(t("devise_views.users.registrations.new.organization_signup_link"), + new_organization_registration_path))) %>

    @@ -34,12 +35,12 @@ <% end %> <%= f.check_box :terms_of_service, - title: t("devise_views.users.registrations.new.terms_title"), - label: t("devise_views.users.registrations.new.terms", - terms: link_to(t("devise_views.users.registrations.new.terms_link"), "/conditions", - title: t("shared.target_blank"), - target: "_blank") - ) %> + title: t("devise_views.users.registrations.new.terms_title"), + label: t("devise_views.users.registrations.new.terms", + terms: link_to(t("devise_views.users.registrations.new.terms_link"), "/conditions", + title: t("shared.target_blank"), + target: "_blank") + ) %>
    <%= f.submit t("devise_views.users.registrations.new.submit"), class: "button expanded" %> diff --git a/app/views/users/registrations/success.html.erb b/app/views/users/registrations/success.html.erb index b1e280398..c5f8cb77f 100644 --- a/app/views/users/registrations/success.html.erb +++ b/app/views/users/registrations/success.html.erb @@ -5,5 +5,6 @@

    <%= t("devise_views.users.registrations.success.instructions_2") %>

    <%= link_to t("devise_views.users.registrations.success.back_to_index"), - root_path, class: "button margin-top expanded" %> + root_path, + class: "button margin-top expanded" %>

    diff --git a/app/views/valuation/budget_investments/_dossier_form.html.erb b/app/views/valuation/budget_investments/_dossier_form.html.erb index 243d9f147..5f2f80f80 100644 --- a/app/views/valuation/budget_investments/_dossier_form.html.erb +++ b/app/views/valuation/budget_investments/_dossier_form.html.erb @@ -42,14 +42,14 @@
    <%= f.number_field :price, - label: t("valuation.budget_investments.edit.price", currency: budget.currency_symbol), - max: 1000000000000000 %> + label: t("valuation.budget_investments.edit.price", currency: budget.currency_symbol), + max: 1000000000000000 %>
    <%= f.number_field :price_first_year, - label: t("valuation.budget_investments.edit.price_first_year", currency: budget.currency_symbol), - max: 1000000000000000 %> + label: t("valuation.budget_investments.edit.price_first_year", currency: budget.currency_symbol), + max: 1000000000000000 %>
    @@ -73,9 +73,9 @@
    <%= f.check_box :valuation_finished, - id: "js-investment-report-alert", - "data-alert": t("valuation.budget_investments.edit.valuation_finished_alert"), - "data-not-feasible-alert": t("valuation.budget_investments.edit.not_feasible_alert") %> + id: "js-investment-report-alert", + "data-alert": t("valuation.budget_investments.edit.valuation_finished_alert"), + "data-not-feasible-alert": t("valuation.budget_investments.edit.not_feasible_alert") %>
    diff --git a/app/views/verification/residence/new.html.erb b/app/views/verification/residence/new.html.erb index 8cc5c745a..e62e890f4 100644 --- a/app/views/verification/residence/new.html.erb +++ b/app/views/verification/residence/new.html.erb @@ -64,17 +64,17 @@
    <%= f.text_field :postal_code, - hint: t("verification.residence.new.postal_code_note") %> + hint: t("verification.residence.new.postal_code_note") %>
    <%= f.check_box :terms_of_service, - title: t("verification.residence.new.accept_terms_text_title"), - label: t("verification.residence.new.accept_terms_text", - terms_url: link_to(t("verification.residence.new.terms"), page_path("census_terms"), - title: t("shared.target_blank"), - target: "_blank") - ) %> + title: t("verification.residence.new.accept_terms_text_title"), + label: t("verification.residence.new.accept_terms_text", + terms_url: link_to(t("verification.residence.new.terms"), page_path("census_terms"), + title: t("shared.target_blank"), + target: "_blank") + ) %>
    diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index c31ab5398..717986f95 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -8,7 +8,7 @@ <% provide :social_media_meta_tags do %> <%= render "shared/social_media_meta_tags", - social_url: root_url %> + social_url: root_url %> <% end %> <%= render "shared/header", header: @header %> @@ -34,7 +34,7 @@ <% if feature?("user.recommendations") && (@recommended_debates.present? || @recommended_proposals.present?) %> <%= render "recommended", - recommended_debates: @recommended_debates, - recommended_proposals: @recommended_proposals %> + recommended_debates: @recommended_debates, + recommended_proposals: @recommended_proposals %> <% end %> diff --git a/bin/rspec b/bin/rspec index 76b37c19f..b50d67608 100755 --- a/bin/rspec +++ b/bin/rspec @@ -14,7 +14,7 @@ end require "pathname" ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) + Pathname.new(__FILE__).realpath) require "rubygems" require "bundler/setup" diff --git a/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb b/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb index b02a24f74..8edb1c972 100644 --- a/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb +++ b/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb @@ -1,11 +1,11 @@ class AddTimeZoneToDefaultDatetimes < ActiveRecord::Migration[4.2] def change change_column_default :users, :password_changed_at, - from: Time.zone.local(2015, 1, 1, 1, 1, 1), - to: DateTime.new(2015, 1, 1, 1, 1, 1, "+00:00") + from: Time.zone.local(2015, 1, 1, 1, 1, 1), + to: DateTime.new(2015, 1, 1, 1, 1, 1, "+00:00") change_column_default :locks, :locked_until, - from: Time.zone.local(2000, 1, 1, 1, 1, 1), - to: DateTime.new(2000, 1, 1, 1, 1, 1, "+00:00") + from: Time.zone.local(2000, 1, 1, 1, 1, 1), + to: DateTime.new(2000, 1, 1, 1, 1, 1, "+00:00") end end diff --git a/spec/components/sdg/tag_list_component_spec.rb b/spec/components/sdg/tag_list_component_spec.rb index d61f3029d..1139ae6ef 100644 --- a/spec/components/sdg/tag_list_component_spec.rb +++ b/spec/components/sdg/tag_list_component_spec.rb @@ -3,8 +3,8 @@ require "rails_helper" describe SDG::TagListComponent do let(:debate) do create(:debate, - sdg_goals: [SDG::Goal[3]], - sdg_targets: [SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")] + sdg_goals: [SDG::Goal[3]], + sdg_targets: [SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")] ) end let(:component) { SDG::TagListComponent.new(debate) } diff --git a/spec/components/sdg/targets/plain_tag_list_component_spec.rb b/spec/components/sdg/targets/plain_tag_list_component_spec.rb index 9606153b9..04bd08cad 100644 --- a/spec/components/sdg/targets/plain_tag_list_component_spec.rb +++ b/spec/components/sdg/targets/plain_tag_list_component_spec.rb @@ -58,7 +58,7 @@ describe SDG::Targets::PlainTagListComponent do expect(page).to have_css "li", text: "target 1.1" expect(page).to have_selector "a", count: 1 expect(page).to have_link "2+", - title: "2 more targets", - href: "/debates/#{debate.to_param}" + title: "2 more targets", + href: "/debates/#{debate.to_param}" end end diff --git a/spec/components/sdg/targets/tag_list_component_spec.rb b/spec/components/sdg/targets/tag_list_component_spec.rb index db8a7bcff..b2dcf1146 100644 --- a/spec/components/sdg/targets/tag_list_component_spec.rb +++ b/spec/components/sdg/targets/tag_list_component_spec.rb @@ -40,14 +40,14 @@ describe SDG::Targets::TagListComponent do expect(page).to have_css "li", count: 3 expect(page).to have_link "target 1.1", - title: "See all Debates related to target 1.1", - href: "/debates?advanced_search#{CGI.escape("[target]")}=1.1" + title: "See all Debates related to target 1.1", + href: "/debates?advanced_search#{CGI.escape("[target]")}=1.1" expect(page).to have_link "target 3.2", - title: "See all Debates related to target 3.2", - href: "/debates?advanced_search#{CGI.escape("[target]")}=3.2" + title: "See all Debates related to target 3.2", + href: "/debates?advanced_search#{CGI.escape("[target]")}=3.2" expect(page).to have_link "target 3.2.1", - title: "See all Debates related to target 3.2.1", - href: "/debates?advanced_search#{CGI.escape("[target]")}=3.2.1" + title: "See all Debates related to target 3.2.1", + href: "/debates?advanced_search#{CGI.escape("[target]")}=3.2.1" end it "orders targets by code" do @@ -64,7 +64,7 @@ describe SDG::Targets::TagListComponent do expect(page).to have_selector "a", count: 2 expect(page).to have_link "target 1.1" expect(page).to have_link "2+", - title: "2 more targets", - href: "/debates/#{debate.to_param}" + title: "2 more targets", + href: "/debates/#{debate.to_param}" end end diff --git a/spec/components/valuation/budgets/row_component_spec.rb b/spec/components/valuation/budgets/row_component_spec.rb index 63d0e7370..212096a82 100644 --- a/spec/components/valuation/budgets/row_component_spec.rb +++ b/spec/components/valuation/budgets/row_component_spec.rb @@ -30,9 +30,9 @@ describe Valuation::Budgets::RowComponent do it "does not count investments with valuation finished" do budget = create(:budget, :valuating) create(:budget_investment, :visible_to_valuators, - budget: budget, - valuators: [valuator], - valuation_finished: true) + budget: budget, + valuators: [valuator], + valuation_finished: true) render_inline Valuation::Budgets::RowComponent.new(budget: budget) @@ -81,9 +81,9 @@ describe Valuation::Budgets::RowComponent do it "is shown when the assigned investments have finished valuation" do budget = create(:budget, :valuating) create(:budget_investment, :visible_to_valuators, - budget: budget, - valuators: [valuator], - valuation_finished: true) + budget: budget, + valuators: [valuator], + valuation_finished: true) render_inline Valuation::Budgets::RowComponent.new(budget: budget) diff --git a/spec/factories/polls.rb b/spec/factories/polls.rb index ed493c21c..0819457b9 100644 --- a/spec/factories/polls.rb +++ b/spec/factories/polls.rb @@ -179,8 +179,8 @@ FactoryBot.define do officer_assignment do association :poll_officer_assignment, - booth_assignment: booth_assignment, - officer: officer || association(:poll_officer) + booth_assignment: booth_assignment, + officer: officer || association(:poll_officer) end end diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb index 0d8c5a0c2..41bc9fc28 100644 --- a/spec/i18n_spec.rb +++ b/spec/i18n_spec.rb @@ -8,12 +8,12 @@ describe "I18n" do it "does not have missing keys" do expect(missing_keys).to be_empty, - "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them" + "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them" end it "does not have unused keys" do expect(unused_keys).to be_empty, - "#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them" + "#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them" end context "Plurals" do diff --git a/spec/models/dashboard/action_spec.rb b/spec/models/dashboard/action_spec.rb index 5364ff64c..5a10ffdd4 100644 --- a/spec/models/dashboard/action_spec.rb +++ b/spec/models/dashboard/action_spec.rb @@ -290,9 +290,9 @@ describe Dashboard::Action do it "when proposal has been created today and day_offset is valid only for today" do expect(Dashboard::Action.detect_new_actions_since(Date.yesterday, - proposal)).to include(resource.id) + proposal)).to include(resource.id) expect(Dashboard::Action.detect_new_actions_since(Date.yesterday, - proposal)).to include(action.id) + proposal)).to include(action.id) end it "when proposal has received a new vote today" do @@ -302,9 +302,9 @@ describe Dashboard::Action do create(:vote, voter: proposal.author, votable: proposal) expect(Dashboard::Action.detect_new_actions_since(Date.yesterday, - proposal)).to include(action.id) + proposal)).to include(action.id) expect(Dashboard::Action.detect_new_actions_since(Date.yesterday, - proposal)).not_to include(resource.id) + proposal)).not_to include(resource.id) end end @@ -321,9 +321,9 @@ describe Dashboard::Action do it "when day_offset field is valid for today and invalid for yesterday" do expect(Dashboard::Action.detect_new_actions_since(Date.yesterday, - proposal)).to include(resource.id) + proposal)).to include(resource.id) expect(Dashboard::Action.detect_new_actions_since(Date.yesterday, - proposal)).to include(action.id) + proposal)).to include(action.id) end it "when proposal has received a new vote today" do @@ -333,9 +333,9 @@ describe Dashboard::Action do create(:vote, voter: proposal.author, votable: proposal) expect(Dashboard::Action.detect_new_actions_since(Date.yesterday, - proposal)).to include(action.id) + proposal)).to include(action.id) expect(Dashboard::Action.detect_new_actions_since(Date.yesterday, - proposal)).not_to include(resource.id) + proposal)).not_to include(resource.id) end end end diff --git a/spec/models/legislation/annotation_spec.rb b/spec/models/legislation/annotation_spec.rb index 965eac3e8..b06d55696 100644 --- a/spec/models/legislation/annotation_spec.rb +++ b/spec/models/legislation/annotation_spec.rb @@ -21,7 +21,8 @@ RSpec.describe Legislation::Annotation, type: :model do " ea. Per ne impedit iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id."\ "\n\n"\ "His audiam" - annotation = create(:legislation_annotation, + annotation = create( + :legislation_annotation, draft_version: draft_version, quote: quote, ranges: [{ "start" => "/p[1]", "startOffset" => 6, "end" => "/p[3]", "endOffset" => 11 }] @@ -46,7 +47,8 @@ RSpec.describe Legislation::Annotation, type: :model do " facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore"\ " te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant"\ " aeterno interesset at. Usu ea mundi tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo" - annotation = create(:legislation_annotation, + annotation = create( + :legislation_annotation, draft_version: draft_version, quote: quote, ranges: [{ "start" => "/p[1]", "startOffset" => 273, "end" => "/p[2]", "endOffset" => 190 }] @@ -92,7 +94,8 @@ RSpec.describe Legislation::Annotation, type: :model do " freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of"\ " free software (and charge for them if you wish)" - annotation = create(:legislation_annotation, + annotation = create( + :legislation_annotation, draft_version: draft_version, quote: quote, ranges: [{ "start" => "/p[2]", "startOffset" => 127, "end" => "/p[3]", "endOffset" => 223 }] diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 947df5e94..fc295d20f 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -491,16 +491,16 @@ describe User do describe "#erase" do it "erases user information and marks him as erased" do user = create(:user, - username: "manolo", - email: "a@a.com", - unconfirmed_email: "a@a.com", - phone_number: "5678", - confirmed_phone: "5678", - unconfirmed_phone: "5678", - encrypted_password: "foobar", - confirmation_token: "token1", - reset_password_token: "token2", - email_verification_token: "token3") + username: "manolo", + email: "a@a.com", + unconfirmed_email: "a@a.com", + phone_number: "5678", + confirmed_phone: "5678", + unconfirmed_phone: "5678", + encrypted_password: "foobar", + confirmation_token: "token1", + reset_password_token: "token2", + email_verification_token: "token3") user.erase("a test") user.reload diff --git a/spec/system/admin/budget_investments_spec.rb b/spec/system/admin/budget_investments_spec.rb index 904ce0c2c..1f1514990 100644 --- a/spec/system/admin/budget_investments_spec.rb +++ b/spec/system/admin/budget_investments_spec.rb @@ -301,16 +301,20 @@ describe "Admin budget investments", :admin do end scenario "Filtering by under valuation" do - create(:budget_investment, + create( + :budget_investment, :with_administrator, :with_valuator, :open, title: "Investment without valuation", - budget: budget) - create(:budget_investment, + budget: budget + ) + create( + :budget_investment, :with_administrator, title: "Investment with valuation", - budget: budget) + budget: budget + ) visit admin_budget_budget_investments_path(budget_id: budget) expect(page).to have_link("Investment without valuation") @@ -928,12 +932,12 @@ describe "Admin budget investments", :admin do user = create(:user, username: "Rachel", email: "rachel@valuators.org") valuator = create(:valuator, user: user) budget_investment = create(:budget_investment, - :unfeasible, - unfeasibility_explanation: "It is impossible", - price: 1234, - price_first_year: 1000, - administrator: administrator, - valuators: [valuator] + :unfeasible, + unfeasibility_explanation: "It is impossible", + price: 1234, + price_first_year: 1000, + administrator: administrator, + valuators: [valuator] ) visit admin_budget_budget_investments_path(budget_investment.budget) @@ -960,12 +964,12 @@ describe "Admin budget investments", :admin do scenario "Show image and documents on investment details" do budget_investment = create(:budget_investment, - :with_image, - :unfeasible, - unfeasibility_explanation: "It is impossible", - price: 1234, - price_first_year: 1000, - administrator: administrator) + :with_image, + :unfeasible, + unfeasibility_explanation: "It is impossible", + price: 1234, + price_first_year: 1000, + administrator: administrator) document = create(:document, documentable: budget_investment) visit admin_budget_budget_investments_path(budget_investment.budget) @@ -990,10 +994,10 @@ describe "Admin budget investments", :admin do scenario "Does not show related content or hide links on preview" do budget_investment = create(:budget_investment, - :unfeasible, - price: 1234, - price_first_year: 1000, - administrator: administrator) + :unfeasible, + price: 1234, + price_first_year: 1000, + administrator: administrator) visit admin_budget_budget_investments_path(budget_investment.budget) @@ -1006,8 +1010,8 @@ describe "Admin budget investments", :admin do scenario "If budget is finished, investment cannot be edited or valuation comments created" do finished_budget = create(:budget, :finished) budget_investment = create(:budget_investment, - budget: finished_budget, - administrator: administrator) + budget: finished_budget, + administrator: administrator) visit admin_budget_budget_investments_path(budget_investment.budget) within_window(window_opened_by { click_link budget_investment.title }) do @@ -1750,10 +1754,10 @@ describe "Admin budget investments", :admin do context "Columns chooser" do let!(:investment) do create(:budget_investment, - :winner, - :visible_to_valuators, - budget: budget, - author: create(:user, username: "Jon Doe") + :winner, + :visible_to_valuators, + budget: budget, + author: create(:user, username: "Jon Doe") ) end let(:default_columns) do diff --git a/spec/system/admin/poll/booth_assigments_spec.rb b/spec/system/admin/poll/booth_assigments_spec.rb index 6e9ebe695..3ca2df05d 100644 --- a/spec/system/admin/poll/booth_assigments_spec.rb +++ b/spec/system/admin/poll/booth_assigments_spec.rb @@ -240,34 +240,34 @@ describe "Admin booths assignments", :admin do create(:poll_question_answer, title: "Tomorrow", question: question_2) create(:poll_partial_result, - booth_assignment: booth_assignment, - question: question_1, - answer: "Yes", - amount: 11) + booth_assignment: booth_assignment, + question: question_1, + answer: "Yes", + amount: 11) create(:poll_partial_result, - booth_assignment: booth_assignment, - question: question_1, - answer: "No", - amount: 4) + booth_assignment: booth_assignment, + question: question_1, + answer: "No", + amount: 4) create(:poll_partial_result, - booth_assignment: booth_assignment, - question: question_2, - answer: "Today", - amount: 5) + booth_assignment: booth_assignment, + question: question_2, + answer: "Today", + amount: 5) create(:poll_partial_result, - booth_assignment: booth_assignment, - question: question_2, - answer: "Tomorrow", - amount: 6) + booth_assignment: booth_assignment, + question: question_2, + answer: "Tomorrow", + amount: 6) create(:poll_partial_result, - booth_assignment: other_booth_assignment, - question: question_1, - answer: "Yes", - amount: 9999) + booth_assignment: other_booth_assignment, + question: question_1, + answer: "Yes", + amount: 9999) create(:poll_recount, booth_assignment: booth_assignment, diff --git a/spec/system/admin/poll/polls_spec.rb b/spec/system/admin/poll/polls_spec.rb index 202c6b394..88aac7ae3 100644 --- a/spec/system/admin/poll/polls_spec.rb +++ b/spec/system/admin/poll/polls_spec.rb @@ -435,15 +435,15 @@ describe "Admin polls", :admin do [booth_assignment_1, booth_assignment_2, booth_assignment_3].each do |ba| create(:poll_partial_result, - booth_assignment: ba, - question: question_1, - answer: "Yes", - amount: 11) + booth_assignment: ba, + question: question_1, + answer: "Yes", + amount: 11) create(:poll_partial_result, - booth_assignment: ba, - question: question_2, - answer: "Tomorrow", - amount: 5) + booth_assignment: ba, + question: question_2, + answer: "Tomorrow", + amount: 5) end create(:poll_recount, booth_assignment: booth_assignment_1, diff --git a/spec/system/admin/site_customization/content_blocks_spec.rb b/spec/system/admin/site_customization/content_blocks_spec.rb index ef3e35d29..20e74b573 100644 --- a/spec/system/admin/site_customization/content_blocks_spec.rb +++ b/spec/system/admin/site_customization/content_blocks_spec.rb @@ -26,7 +26,7 @@ describe "Admin custom content blocks", :admin do click_link "Create new content block" select I18n.t("admin.site_customization.content_blocks.content_block.names.footer"), - from: "site_customization_content_block_name" + from: "site_customization_content_block_name" select "es", from: "site_customization_content_block_locale" fill_in "site_customization_content_block_body", with: "Some custom content" @@ -51,7 +51,7 @@ describe "Admin custom content blocks", :admin do click_link "Create new content block" select I18n.t("admin.site_customization.content_blocks.content_block.names.top_links"), - from: "site_customization_content_block_name" + from: "site_customization_content_block_name" select "en", from: "site_customization_content_block_locale" fill_in "site_customization_content_block_body", with: "Some custom content" diff --git a/spec/system/admin/system_emails_spec.rb b/spec/system/admin/system_emails_spec.rb index 7c6cdc2f1..27b094b1f 100644 --- a/spec/system/admin/system_emails_spec.rb +++ b/spec/system/admin/system_emails_spec.rb @@ -254,11 +254,13 @@ describe "System Emails" do describe "#evaluation_comment" do scenario "render correctly evaluaton comment mailer with valuator as a sample user" do admin = create(:administrator, user: create(:user, username: "Baby Doe")) - investment = create(:budget_investment, + investment = create( + :budget_investment, title: "Cleaner city", heading: heading, author: user, - administrator: admin) + administrator: admin + ) comment = create(:comment, :valuation, commentable: investment) visit admin_system_email_view_path("evaluation_comment") @@ -270,7 +272,12 @@ describe "System Emails" do expect(page).to have_content comment.body expect(page).to have_link "Cleaner city", - href: admin_budget_budget_investment_url(investment.budget, investment, anchor: "comments", host: app_host) + href: admin_budget_budget_investment_url( + investment.budget, + investment, + anchor: "comments", + host: app_host + ) end scenario "uses a current_user as a sample user for sample regular comments" do diff --git a/spec/system/admin/widgets/cards_spec.rb b/spec/system/admin/widgets/cards_spec.rb index af4f215d2..d34549503 100644 --- a/spec/system/admin/widgets/cards_spec.rb +++ b/spec/system/admin/widgets/cards_spec.rb @@ -168,7 +168,7 @@ describe "Cards", :admin do click_link "Create card" expect(page).to have_link("Go back", - href: admin_site_customization_page_widget_cards_path(custom_page)) + href: admin_site_customization_page_widget_cards_path(custom_page)) fill_in "Title", with: "Card for a custom page" fill_in "Link URL", with: "/any_path" @@ -230,7 +230,7 @@ describe "Cards", :admin do click_link "Edit" expect(page).to have_link("Go back", - href: admin_site_customization_page_widget_cards_path(custom_page)) + href: admin_site_customization_page_widget_cards_path(custom_page)) within(".translatable-fields") do fill_in "Title", with: "Updated title" diff --git a/spec/system/budgets/ballots_spec.rb b/spec/system/budgets/ballots_spec.rb index 62653fdb0..ccd80d364 100644 --- a/spec/system/budgets/ballots_spec.rb +++ b/spec/system/budgets/ballots_spec.rb @@ -163,12 +163,14 @@ describe "Ballots" do scenario "map and content block shoud be visible before and after" do stub_const("#{Budgets::InvestmentsController}::PER_PAGE", 1) - create(:budget_investment, :selected, :with_map_location, + create( + :budget_investment, :selected, :with_map_location, heading: new_york, price: 10000, title: "More bridges", ) - create(:budget_investment, :selected, :with_map_location, + create( + :budget_investment, :selected, :with_map_location, heading: new_york, price: 5000, title: "Less bridges" diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb index ee74fa7be..917b60f36 100644 --- a/spec/system/budgets/investments_spec.rb +++ b/spec/system/budgets/investments_spec.rb @@ -645,7 +645,7 @@ describe "Budget Investments" do visit new_budget_investment_path(budget) expect(page).to have_select "Heading", - options: ["", "More hospitals", "Medical supplies", "Even more hospitals"] + options: ["", "More hospitals", "Medical supplies", "Even more hospitals"] expect(page).not_to have_content "Health" end @@ -661,7 +661,7 @@ describe "Budget Investments" do expect(page).not_to have_content("#{heading.name} (#{budget.formatted_heading_price(heading)})") expect(page).to have_select "Heading", - options: ["", "Health: More hospitals", "Health: Medical supplies", "Education: Schools"] + options: ["", "Health: More hospitals", "Health: Medical supplies", "Education: Schools"] select "Health: Medical supplies", from: "Heading" @@ -987,11 +987,11 @@ describe "Budget Investments" do unfeasibility_explanation: "Local government is not competent in this") investment_2 = create(:budget_investment, - :unfeasible, - :finished, - budget: budget, - heading: heading, - unfeasibility_explanation: "The unfeasible explanation") + :unfeasible, + :finished, + budget: budget, + heading: heading, + unfeasibility_explanation: "The unfeasible explanation") user = create(:user) login_as(user) diff --git a/spec/system/comments/budget_investments_spec.rb b/spec/system/comments/budget_investments_spec.rb index c8df55a93..6f7c6e55d 100644 --- a/spec/system/comments/budget_investments_spec.rb +++ b/spec/system/comments/budget_investments_spec.rb @@ -469,9 +469,9 @@ describe "Commenting Budget::Investments" do manuela = create(:user, username: "Manuela") admin = create(:administrator, user: manuela) comment = create(:comment, - commentable: investment, - user: manuela, - administrator_id: admin.id) + commentable: investment, + user: manuela, + administrator_id: admin.id) visit budget_investment_path(investment.budget, investment) diff --git a/spec/system/dashboard/dashboard_spec.rb b/spec/system/dashboard/dashboard_spec.rb index 92721cccb..58b8f9d4f 100644 --- a/spec/system/dashboard/dashboard_spec.rb +++ b/spec/system/dashboard/dashboard_spec.rb @@ -25,9 +25,9 @@ describe "Proposal's dashboard" do scenario "Dashboard progress shows current goal" do goal = create(:dashboard_action, :resource, :active, - required_supports: proposal.votes_for.size + 1_000) + required_supports: proposal.votes_for.size + 1_000) future_goal = create(:dashboard_action, :resource, :active, - required_supports: proposal.votes_for.size + 2_000) + required_supports: proposal.votes_for.size + 2_000) visit progress_proposal_dashboard_path(proposal) @@ -58,10 +58,10 @@ describe "Proposal's dashboard" do scenario "Dashboard progress show proposed actions truncated description" do action = create(:dashboard_action, :proposed_action, :active, description: "One short action") action_long = create(:dashboard_action, :proposed_action, :active, - description: "This is a really very long description for a proposed "\ - "action on progress dashboard section, so this description "\ - "should be appear truncated and shows the show description "\ - "link to show the complete description to the users.") + description: "This is a really very long description for a proposed "\ + "action on progress dashboard section, so this description "\ + "should be appear truncated and shows the show description "\ + "link to show the complete description to the users.") visit progress_proposal_dashboard_path(proposal) @@ -165,7 +165,7 @@ describe "Proposal's dashboard" do _solved_task = create(:dashboard_administrator_task, :done, source: executed_solved_action) unavailable = create(:dashboard_action, :resource, :active, - required_supports: proposal.votes_for.size + 1_000) + required_supports: proposal.votes_for.size + 1_000) visit progress_proposal_dashboard_path(proposal) within "div#available-resources-section" do @@ -212,7 +212,7 @@ describe "Proposal's dashboard" do _solved_task = create(:dashboard_administrator_task, :done, source: executed_solved_action) unavailable = create(:dashboard_action, :resource, :active, - required_supports: proposal.votes_for.size + 1_000) + required_supports: proposal.votes_for.size + 1_000) visit progress_proposal_dashboard_path(proposal) within "div#available-resources-section" do @@ -245,8 +245,8 @@ describe "Proposal's dashboard" do scenario "Dashboard progress dont show resources with published_proposal: true" do available = create(:dashboard_action, :resource, :active, published_proposal: true) unavailable = create(:dashboard_action, :resource, :active, - required_supports: proposal.votes_for.size + 1_000, - published_proposal: true) + required_supports: proposal.votes_for.size + 1_000, + published_proposal: true) visit progress_proposal_dashboard_path(proposal) @@ -381,7 +381,7 @@ describe "Proposal's dashboard" do visit messages_proposal_dashboard_path(proposal) expect(page).to have_link("See previous notifications", href: proposal_path(proposal, - anchor: "tab-notifications")) + anchor: "tab-notifications")) end scenario "Dashboard has a related content section" do diff --git a/spec/system/home_spec.rb b/spec/system/home_spec.rb index 6a2a36456..f74659a07 100644 --- a/spec/system/home_spec.rb +++ b/spec/system/home_spec.rb @@ -157,7 +157,8 @@ describe "Home" do end scenario "if there are cards, the 'featured' title will render" do - create(:widget_card, + create( + :widget_card, title: "Card text", description: "Card description", link_text: "Link text", diff --git a/spec/system/legislation/summary_spec.rb b/spec/system/legislation/summary_spec.rb index 443649937..5bab2d84d 100644 --- a/spec/system/legislation/summary_spec.rb +++ b/spec/system/legislation/summary_spec.rb @@ -21,8 +21,8 @@ describe "Legislation" do scenario "empty process" do process = create(:legislation_process, :empty, - result_publication_enabled: true, - end_date: Date.current - 1.day + result_publication_enabled: true, + end_date: Date.current - 1.day ) visit summary_legislation_process_path(process) diff --git a/spec/system/moderation/budget_investments_spec.rb b/spec/system/moderation/budget_investments_spec.rb index 0ec232715..bf8ec87d1 100644 --- a/spec/system/moderation/budget_investments_spec.rb +++ b/spec/system/moderation/budget_investments_spec.rb @@ -197,21 +197,24 @@ describe "Moderate budget investments" do end scenario "sorting investments" do - flagged_investment = create(:budget_investment, + flagged_investment = create( + :budget_investment, heading: heading, title: "Flagged investment", created_at: 1.day.ago, flags_count: 5 ) - flagged_new_investment = create(:budget_investment, + flagged_new_investment = create( + :budget_investment, heading: heading, title: "Flagged new investment", created_at: 12.hours.ago, flags_count: 3 ) - latest_investment = create(:budget_investment, + latest_investment = create( + :budget_investment, heading: heading, title: "Latest investment", created_at: Time.current diff --git a/spec/system/officing/results_spec.rb b/spec/system/officing/results_spec.rb index 4ffe58cc4..7fa0d8926 100644 --- a/spec/system/officing/results_spec.rb +++ b/spec/system/officing/results_spec.rb @@ -80,14 +80,16 @@ describe "Officing Results", :with_frozen_time do end scenario "Edit result" do - partial_result = create(:poll_partial_result, - officer_assignment: poll_officer.officer_assignments.first, - booth_assignment: poll_officer.officer_assignments.first.booth_assignment, - date: Date.current, - question: question_1, - answer: question_1.question_answers.first.title, - author: poll_officer.user, - amount: 7777) + partial_result = create( + :poll_partial_result, + officer_assignment: poll_officer.officer_assignments.first, + booth_assignment: poll_officer.officer_assignments.first.booth_assignment, + date: Date.current, + question: question_1, + answer: question_1.question_answers.first.title, + author: poll_officer.user, + amount: 7777 + ) visit officing_poll_results_path(poll, date: I18n.l(partial_result.date), booth_assignment_id: partial_result.booth_assignment_id) @@ -129,20 +131,24 @@ describe "Officing Results", :with_frozen_time do booth_assignment = officer_assignment.booth_assignment booth = booth_assignment.booth - create(:poll_partial_result, + create( + :poll_partial_result, officer_assignment: officer_assignment, booth_assignment: booth_assignment, date: poll.ends_at, question: question_1, - amount: 33) + amount: 33 + ) - create(:poll_recount, + create( + :poll_recount, officer_assignment: officer_assignment, booth_assignment: booth_assignment, date: poll.ends_at, white_amount: 21, null_amount: 44, - total_amount: 66) + total_amount: 66 + ) visit officing_poll_results_path(poll, date: I18n.l(poll.ends_at.to_date), diff --git a/spec/system/proposal_notifications_spec.rb b/spec/system/proposal_notifications_spec.rb index d15889dcc..e3dba91ab 100644 --- a/spec/system/proposal_notifications_spec.rb +++ b/spec/system/proposal_notifications_spec.rb @@ -79,11 +79,11 @@ describe "Proposal Notifications" do proposal = create(:proposal) create(:proposal_notification, - proposal: proposal, title: "Hey guys", - body: "Just wanted to let you know that...") + proposal: proposal, title: "Hey guys", + body: "Just wanted to let you know that...") create(:proposal_notification, - proposal: proposal, title: "Another update", - body: "We are almost there please share with your peoples!") + proposal: proposal, title: "Another update", + body: "We are almost there please share with your peoples!") visit proposal_path(proposal) click_link "Notifications (2)" @@ -107,7 +107,7 @@ describe "Proposal Notifications" do expect(page).to have_content "This notification will be sent to 7 people and it will "\ "be visible in the proposal's page" expect(page).to have_link("the proposal's page", href: proposal_path(proposal, - anchor: "comments")) + anchor: "comments")) end scenario "Message about receivers (Disctinct Followers and Voters)" do @@ -123,7 +123,7 @@ describe "Proposal Notifications" do expect(page).to have_content "This notification will be sent to 7 people and it will "\ "be visible in the proposal's page" expect(page).to have_link("the proposal's page", href: proposal_path(proposal, - anchor: "comments")) + anchor: "comments")) end scenario "Message about receivers (Same Followers and Voters)" do @@ -138,7 +138,7 @@ describe "Proposal Notifications" do expect(page).to have_content "This notification will be sent to 1 people and it will "\ "be visible in the proposal's page" expect(page).to have_link("the proposal's page", href: proposal_path(proposal, - anchor: "comments")) + anchor: "comments")) end context "Permissions" do diff --git a/spec/system/proposals_spec.rb b/spec/system/proposals_spec.rb index bf0dcb2a9..5969d856a 100644 --- a/spec/system/proposals_spec.rb +++ b/spec/system/proposals_spec.rb @@ -1000,7 +1000,7 @@ describe "Proposals" do Setting["feature.featured_proposals"] = true featured_proposal = create(:proposal, :with_confidence_score, cached_votes_up: 100) archived_proposal = create(:proposal, :archived, :with_confidence_score, - cached_votes_up: 10000) + cached_votes_up: 10000) visit proposals_path diff --git a/spec/system/site_customization/custom_pages_spec.rb b/spec/system/site_customization/custom_pages_spec.rb index 138b4b0d5..e7586d939 100644 --- a/spec/system/site_customization/custom_pages_spec.rb +++ b/spec/system/site_customization/custom_pages_spec.rb @@ -4,7 +4,8 @@ describe "Custom Pages" do context "New custom page" do context "Published" do scenario "See page" do - custom_page = create(:site_customization_page, :published, + custom_page = create( + :site_customization_page, :published, slug: "other-slug", title_en: "Custom page", content_en: "Text for new custom page", @@ -20,7 +21,8 @@ describe "Custom Pages" do end scenario "Show all fields and text with links" do - custom_page = create(:site_customization_page, :published, + custom_page = create( + :site_customization_page, :published, slug: "slug-with-all-fields-filled", title_en: "Custom page", subtitle_en: "This is my new custom page", @@ -39,7 +41,8 @@ describe "Custom Pages" do end scenario "Don't show subtitle if its blank" do - custom_page = create(:site_customization_page, :published, + custom_page = create( + :site_customization_page, :published, slug: "slug-without-subtitle", title_en: "Custom page", subtitle_en: "", @@ -57,7 +60,8 @@ describe "Custom Pages" do end scenario "Listed in more information page" do - create(:site_customization_page, :published, + create( + :site_customization_page, :published, slug: "another-slug", title_en: "Another custom page", subtitle_en: "Subtitle for custom page", @@ -70,7 +74,8 @@ describe "Custom Pages" do end scenario "Not listed in more information page" do - custom_page = create(:site_customization_page, :published, + custom_page = create( + :site_customization_page, :published, slug: "another-slug", title_en: "Another custom page", subtitle_en: "Subtitle for custom page", more_info_flag: false diff --git a/spec/system/verification/residence_spec.rb b/spec/system/verification/residence_spec.rb index 22ad66d11..c54e44fee 100644 --- a/spec/system/verification/residence_spec.rb +++ b/spec/system/verification/residence_spec.rb @@ -48,9 +48,9 @@ describe "Residence" do click_link "Verify my account" expect(page).to have_select("residence_date_of_birth_1i", - with_options: [min_age.years.ago.year]) + with_options: [min_age.years.ago.year]) expect(page).not_to have_select("residence_date_of_birth_1i", - with_options: [underage.years.ago.year]) + with_options: [underage.years.ago.year]) end scenario "When trying to verify a deregistered account old votes are reassigned" do From 5b6de962411e3bd0e5a7bd8eca42b3720ab69c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 1 Jul 2023 18:08:54 +0200 Subject: [PATCH 07/13] Add and apply MultilineMethodCallIndentation rule --- .rubocop.yml | 3 +++ .../budgets/executions/image_component.rb | 6 +++-- .../admin/legislation/processes_controller.rb | 5 ++-- .../poll/officer_assignments_controller.rb | 10 ++++---- .../admin/verifications_controller.rb | 7 +++--- .../dashboard/achievements_controller.rb | 12 +++++----- .../legislation/processes_controller.rb | 7 ++++-- .../officing/ballot_sheets_controller.rb | 12 +++++----- .../officing/results_controller.rb | 20 ++++++++-------- app/controllers/proposals_controller.rb | 6 +++-- .../admin_budget_investments_helper.rb | 2 +- app/helpers/application_helper.rb | 2 +- app/models/budget/group.rb | 4 ++-- app/models/budget/investment.rb | 2 +- app/models/budget/stats.rb | 4 ++-- app/models/concerns/globalizable.rb | 8 +++---- app/models/dashboard/action.rb | 7 +++--- app/models/poll.rb | 2 +- app/models/poll/officer.rb | 18 +++++++------- app/models/tag_cloud.rb | 8 +++---- .../verification/management/managed_user.rb | 4 ++-- .../annotations/_comments.html.erb | 7 ++++-- spec/factories/sdg.rb | 2 +- spec/lib/remote_translations/caller_spec.rb | 2 +- .../microsoft/client_spec.rb | 24 +++++++++---------- spec/models/comment_spec.rb | 8 +++---- spec/models/debate_spec.rb | 8 +++---- spec/models/legislation/process_spec.rb | 6 ++--- .../local_census_records/import_spec.rb | 2 +- spec/models/proposal_spec.rb | 8 +++---- spec/shared/system/remotely_translatable.rb | 5 ++-- spec/support/common_actions.rb | 4 ++-- .../information_texts_spec.rb | 2 +- spec/system/budgets/votes_spec.rb | 4 ++-- .../management/document_verifications_spec.rb | 10 ++++---- 35 files changed, 131 insertions(+), 110 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 982341268..b0b25095f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -108,6 +108,9 @@ Layout/MultilineHashBraceLayout: Layout/MultilineHashKeyLineBreaks: Enabled: true +Layout/MultilineMethodCallIndentation: + Enabled: true + Layout/MultilineOperationIndentation: Enabled: true diff --git a/app/components/budgets/executions/image_component.rb b/app/components/budgets/executions/image_component.rb index 3058ee46d..d81e225e5 100644 --- a/app/components/budgets/executions/image_component.rb +++ b/app/components/budgets/executions/image_component.rb @@ -9,7 +9,9 @@ class Budgets::Executions::ImageComponent < ApplicationComponent private def milestone - investment.milestones.order_by_publication_date - .select { |milestone| milestone.image.present? }.last + investment.milestones + .order_by_publication_date + .select { |milestone| milestone.image.present? } + .last end end diff --git a/app/controllers/admin/legislation/processes_controller.rb b/app/controllers/admin/legislation/processes_controller.rb index 7396ca654..370236008 100644 --- a/app/controllers/admin/legislation/processes_controller.rb +++ b/app/controllers/admin/legislation/processes_controller.rb @@ -8,8 +8,9 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll load_and_authorize_resource :process, class: "Legislation::Process" def index - @processes = ::Legislation::Process.send(@current_filter).order(start_date: :desc) - .page(params[:page]) + @processes = ::Legislation::Process.send(@current_filter) + .order(start_date: :desc) + .page(params[:page]) end def create diff --git a/app/controllers/admin/poll/officer_assignments_controller.rb b/app/controllers/admin/poll/officer_assignments_controller.rb index 008918c3f..82e45a182 100644 --- a/app/controllers/admin/poll/officer_assignments_controller.rb +++ b/app/controllers/admin/poll/officer_assignments_controller.rb @@ -5,11 +5,11 @@ class Admin::Poll::OfficerAssignmentsController < Admin::Poll::BaseController def index @officers = ::Poll::Officer - .includes(:user) - .order("users.username") - .where( - id: @poll.officer_assignments.select(:officer_id).distinct.map(&:officer_id) - ).page(params[:page]).per(50) + .includes(:user) + .order("users.username") + .where(id: @poll.officer_assignments.select(:officer_id).distinct.map(&:officer_id)) + .page(params[:page]) + .per(50) end def by_officer diff --git a/app/controllers/admin/verifications_controller.rb b/app/controllers/admin/verifications_controller.rb index 3e3671ec3..f4a8b3669 100644 --- a/app/controllers/admin/verifications_controller.rb +++ b/app/controllers/admin/verifications_controller.rb @@ -4,9 +4,10 @@ class Admin::VerificationsController < Admin::BaseController end def search - @users = User.incomplete_verification.search(params[:search]) - .page(params[:page]) - .for_render + @users = User.incomplete_verification + .search(params[:search]) + .page(params[:page]) + .for_render render :index end end diff --git a/app/controllers/dashboard/achievements_controller.rb b/app/controllers/dashboard/achievements_controller.rb index 320dbc2ce..3a1aa34c6 100644 --- a/app/controllers/dashboard/achievements_controller.rb +++ b/app/controllers/dashboard/achievements_controller.rb @@ -37,11 +37,11 @@ class Dashboard::AchievementsController < Dashboard::BaseController def executed_proposed_actions @executed_proposed_actions ||= Dashboard::ExecutedAction - .joins(:action) - .includes(:action) - .where(proposal: proposal) - .where(executed_at: start_date.beginning_of_day..end_date.end_of_day) - .where(dashboard_actions: { action_type: 0 }) - .order(executed_at: :asc) + .joins(:action) + .includes(:action) + .where(proposal: proposal) + .where(executed_at: start_date.beginning_of_day..end_date.end_of_day) + .where(dashboard_actions: { action_type: 0 }) + .order(executed_at: :asc) end end diff --git a/app/controllers/legislation/processes_controller.rb b/app/controllers/legislation/processes_controller.rb index 3ceff8392..c24206182 100644 --- a/app/controllers/legislation/processes_controller.rb +++ b/app/controllers/legislation/processes_controller.rb @@ -10,8 +10,11 @@ class Legislation::ProcessesController < Legislation::BaseController def index @current_filter ||= "open" - @processes = ::Legislation::Process.send(@current_filter).published - .not_in_draft.order(start_date: :desc).page(params[:page]) + @processes = ::Legislation::Process.send(@current_filter) + .published + .not_in_draft + .order(start_date: :desc) + .page(params[:page]) end def show diff --git a/app/controllers/officing/ballot_sheets_controller.rb b/app/controllers/officing/ballot_sheets_controller.rb index fcface1e9..814d26788 100644 --- a/app/controllers/officing/ballot_sheets_controller.rb +++ b/app/controllers/officing/ballot_sheets_controller.rb @@ -43,12 +43,12 @@ class Officing::BallotSheetsController < Officing::BaseController def load_officer_assignments @officer_assignments = ::Poll::OfficerAssignment - .includes(booth_assignment: [:booth]) - .joins(:booth_assignment) - .final - .where(id: current_user.poll_officer.officer_assignment_ids) - .where(poll_booth_assignments: { poll_id: @poll.id }) - .where(date: Date.current) + .includes(booth_assignment: [:booth]) + .joins(:booth_assignment) + .final + .where(id: current_user.poll_officer.officer_assignment_ids) + .where(poll_booth_assignments: { poll_id: @poll.id }) + .where(date: Date.current) end def load_officer_assignment diff --git a/app/controllers/officing/results_controller.rb b/app/controllers/officing/results_controller.rb index 795122400..543607b0c 100644 --- a/app/controllers/officing/results_controller.rb +++ b/app/controllers/officing/results_controller.rb @@ -22,11 +22,11 @@ class Officing::ResultsController < Officing::BaseController def index @booth_assignment = ::Poll::BoothAssignment.includes(:booth).find(index_params[:booth_assignment_id]) if current_user.poll_officer.officer_assignments.final - .where(booth_assignment_id: @booth_assignment.id).exists? + .where(booth_assignment_id: @booth_assignment.id).exists? @partial_results = ::Poll::PartialResult.includes(:question) - .where(booth_assignment_id: index_params[:booth_assignment_id]) - .where(date: index_params[:date]) + .where(booth_assignment_id: index_params[:booth_assignment_id]) + .where(date: index_params[:date]) @recounts = ::Poll::Recount.where(booth_assignment_id: @booth_assignment.id, date: index_params[:date]) end end @@ -90,17 +90,17 @@ class Officing::ResultsController < Officing::BaseController def load_officer_assignment @officer_assignment = current_user.poll_officer - .officer_assignments.final.find_by(id: results_params[:officer_assignment_id]) + .officer_assignments.final.find_by(id: results_params[:officer_assignment_id]) end def load_officer_assignments @officer_assignments = ::Poll::OfficerAssignment - .includes(booth_assignment: [:booth]) - .joins(:booth_assignment) - .final - .where(id: current_user.poll_officer.officer_assignment_ids) - .where(poll_booth_assignments: { poll_id: @poll.id }) - .where(date: Date.current) + .includes(booth_assignment: [:booth]) + .joins(:booth_assignment) + .final + .where(id: current_user.poll_officer.officer_assignment_ids) + .where(poll_booth_assignments: { poll_id: @poll.id }) + .where(date: Date.current) end def load_partial_results diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index 23a186151..656df3e5e 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -155,8 +155,10 @@ class ProposalsController < ApplicationController return unless !@advanced_search_terms && @search_terms.blank? && params[:retired].blank? && @current_order != "recommendations" if Setting["feature.featured_proposals"] - @featured_proposals = Proposal.not_archived.unsuccessful - .sort_by_confidence_score.limit(Setting["featured_proposals_number"]) + @featured_proposals = Proposal.not_archived + .unsuccessful + .sort_by_confidence_score + .limit(Setting["featured_proposals_number"]) if @featured_proposals.present? @resources = @resources.where.not(id: @featured_proposals) end diff --git a/app/helpers/admin_budget_investments_helper.rb b/app/helpers/admin_budget_investments_helper.rb index d3d73988b..014118fd5 100644 --- a/app/helpers/admin_budget_investments_helper.rb +++ b/app/helpers/admin_budget_investments_helper.rb @@ -23,7 +23,7 @@ module AdminBudgetInvestmentsHelper def valuator_select_options(budget) budget.valuators.order("description ASC").order("users.email ASC").includes(:user) - .map { |v| [v.description_or_email, "valuator_#{v.id}"] } + .map { |v| [v.description_or_email, "valuator_#{v.id}"] } end def valuator_group_select_options diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1377b27d2..fb69f2bb9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -48,7 +48,7 @@ module ApplicationHelper def self.asset_data_base64(path) asset = (Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)) - .find_asset(path) + .find_asset(path) throw "Could not find asset '#{path}'" if asset.nil? base64 = Base64.encode64(asset.to_s).gsub(/\s+/, "") "data:#{asset.content_type};base64,#{Rack::Utils.escape(base64)}" diff --git a/app/models/budget/group.rb b/app/models/budget/group.rb index 9ca141725..a2e0164e4 100644 --- a/app/models/budget/group.rb +++ b/app/models/budget/group.rb @@ -11,8 +11,8 @@ class Budget def name_uniqueness_by_budget if budget.groups.joins(:translations) - .where(name: name) - .where.not("budget_group_translations.budget_group_id": budget_group_id).any? + .where(name: name) + .where.not("budget_group_translations.budget_group_id": budget_group_id).any? errors.add(:name, I18n.t("errors.messages.taken")) end end diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 34c2ec2eb..61fe46bc3 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -199,7 +199,7 @@ class Budget with_joins = with_translations(Globalize.fallbacks(I18n.locale)) with_joins.where(id: title_or_id) - .or(with_joins.where("budget_investment_translations.title ILIKE ?", "%#{title_or_id}%")) + .or(with_joins.where("budget_investment_translations.title ILIKE ?", "%#{title_or_id}%")) end def searchable_values diff --git a/app/models/budget/stats.rb b/app/models/budget/stats.rb index bbf01de17..3837bb0f8 100644 --- a/app/models/budget/stats.rb +++ b/app/models/budget/stats.rb @@ -129,8 +129,8 @@ class Budget::Stats def balloters_by_heading(heading_id) stats_cache("balloters_by_heading_#{heading_id}") do budget.ballots.joins(:lines) - .where(budget_ballot_lines: { heading_id: heading_id }) - .distinct.pluck(:user_id) + .where(budget_ballot_lines: { heading_id: heading_id }) + .distinct.pluck(:user_id) end end diff --git a/app/models/concerns/globalizable.rb b/app/models/concerns/globalizable.rb index 0b995350d..8961620e8 100644 --- a/app/models/concerns/globalizable.rb +++ b/app/models/concerns/globalizable.rb @@ -110,10 +110,10 @@ module Globalizable end.join(", ") translations_ids = translation_class - .select("DISTINCT ON (#{translations_foreign_key}) id") - .where(locale: fallbacks) - .joins("LEFT JOIN (VALUES #{fallbacks_with_order}) AS locales(name, ordering) ON locale = locales.name") - .order(translations_foreign_key, "locales.ordering") + .select("DISTINCT ON (#{translations_foreign_key}) id") + .where(locale: fallbacks) + .joins("LEFT JOIN (VALUES #{fallbacks_with_order}) AS locales(name, ordering) ON locale = locales.name") + .order(translations_foreign_key, "locales.ordering") with_translations(fallbacks).where("#{translations_table_name}.id": translations_ids) end diff --git a/app/models/dashboard/action.rb b/app/models/dashboard/action.rb index a669990ce..6287adcab 100644 --- a/app/models/dashboard/action.rb +++ b/app/models/dashboard/action.rb @@ -108,9 +108,10 @@ class Dashboard::Action < ApplicationRecord end def self.calculate_actions(proposal_votes, day_offset, proposal) - Dashboard::Action.active.where("required_supports <= ?", proposal_votes) - .where("day_offset <= ?", day_offset) - .by_published_proposal(proposal.published?) + Dashboard::Action.active + .where("required_supports <= ?", proposal_votes) + .where("day_offset <= ?", day_offset) + .by_published_proposal(proposal.published?) end def self.calculate_votes(proposal, date) diff --git a/app/models/poll.rb b/app/models/poll.rb index c4eef8d39..3d14971fc 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -104,7 +104,7 @@ class Poll < ApplicationRecord return none if user.nil? || user.unverified? current.left_joins(:geozones) - .where("geozone_restricted = ? OR geozones.id = ?", false, user.geozone_id) + .where("geozone_restricted = ? OR geozones.id = ?", false, user.geozone_id) end def self.votable_by(user) diff --git a/app/models/poll/officer.rb b/app/models/poll/officer.rb index f43eb8d04..6c305476f 100644 --- a/app/models/poll/officer.rb +++ b/app/models/poll/officer.rb @@ -16,17 +16,19 @@ class Poll end def voting_days_assigned_polls - officer_assignments.voting_days.includes(booth_assignment: :poll) - .map(&:booth_assignment) - .map(&:poll).uniq.compact - .sort { |x, y| y.ends_at <=> x.ends_at } + officer_assignments.voting_days + .includes(booth_assignment: :poll) + .map(&:booth_assignment) + .map(&:poll).uniq.compact + .sort { |x, y| y.ends_at <=> x.ends_at } end def final_days_assigned_polls - officer_assignments.final.includes(booth_assignment: :poll) - .map(&:booth_assignment) - .map(&:poll).uniq.compact - .sort { |x, y| y.ends_at <=> x.ends_at } + officer_assignments.final + .includes(booth_assignment: :poll) + .map(&:booth_assignment) + .map(&:poll).uniq.compact + .sort { |x, y| y.ends_at <=> x.ends_at } end def todays_booths diff --git a/app/models/tag_cloud.rb b/app/models/tag_cloud.rb index c891e3f5d..f98f799e3 100644 --- a/app/models/tag_cloud.rb +++ b/app/models/tag_cloud.rb @@ -8,10 +8,10 @@ class TagCloud def tags resource_model_scoped - .last_week.send(counts) - .where("lower(name) NOT IN (?)", category_names + geozone_names + default_blacklist) - .order("#{table_name}_count": :desc, name: :asc) - .limit(10) + .last_week.send(counts) + .where("lower(name) NOT IN (?)", category_names + geozone_names + default_blacklist) + .order("#{table_name}_count": :desc, name: :asc) + .limit(10) end def counts diff --git a/app/models/verification/management/managed_user.rb b/app/models/verification/management/managed_user.rb index e4a44e63d..f4f0152f6 100644 --- a/app/models/verification/management/managed_user.rb +++ b/app/models/verification/management/managed_user.rb @@ -3,7 +3,7 @@ class Verification::Management::ManagedUser def self.find(document_type, document_number) User.where.not(document_number: nil) - .find_or_initialize_by(document_type: document_type, - document_number: document_number) + .find_or_initialize_by(document_type: document_type, + document_number: document_number) end end diff --git a/app/views/legislation/annotations/_comments.html.erb b/app/views/legislation/annotations/_comments.html.erb index 33375f40a..aad5a4248 100644 --- a/app/views/legislation/annotations/_comments.html.erb +++ b/app/views/legislation/annotations/_comments.html.erb @@ -1,5 +1,8 @@ -<% annotation.comments.roots.sort_by_most_voted - .limit(Legislation::Annotation::COMMENTS_PAGE_SIZE).each do |comment| %> +<% annotation.comments + .roots + .sort_by_most_voted + .limit(Legislation::Annotation::COMMENTS_PAGE_SIZE) + .each do |comment| %>

    <%= truncate comment.body, length: 250 %>

    diff --git a/spec/factories/sdg.rb b/spec/factories/sdg.rb index 1f933eb04..7a0b9efbd 100644 --- a/spec/factories/sdg.rb +++ b/spec/factories/sdg.rb @@ -22,7 +22,7 @@ FactoryBot.define do factory :sdg_review, class: "SDG::Review" do SDG::Related::RELATABLE_TYPES.map { |relatable_type| relatable_type.downcase.gsub("::", "_") } - .each do |relatable| + .each do |relatable| trait :"#{relatable}_review" do association :relatable, factory: relatable end diff --git a/spec/lib/remote_translations/caller_spec.rb b/spec/lib/remote_translations/caller_spec.rb index 8551096ef..76bc49695 100644 --- a/spec/lib/remote_translations/caller_spec.rb +++ b/spec/lib/remote_translations/caller_spec.rb @@ -221,7 +221,7 @@ describe RemoteTranslations::Caller, :remote_translations do fake_response = ["translated title", "translated description", "translated summary", nil] expect_any_instance_of(client).to receive(:call).with(field_values_sanitized, locale) - .and_return(fake_response) + .and_return(fake_response) caller.call end diff --git a/spec/lib/remote_translations/microsoft/client_spec.rb b/spec/lib/remote_translations/microsoft/client_spec.rb index 903a2ad21..0b9b4c731 100644 --- a/spec/lib/remote_translations/microsoft/client_spec.rb +++ b/spec/lib/remote_translations/microsoft/client_spec.rb @@ -62,13 +62,13 @@ describe RemoteTranslations::Microsoft::Client do response_end_text = [end_translated_text_es] expect_any_instance_of(BingTranslator).to receive(:translate_array).with([start_text_en], to: :es) - .exactly(1) - .times - .and_return(response_start_text) + .exactly(1) + .times + .and_return(response_start_text) expect_any_instance_of(BingTranslator).to receive(:translate_array).with([end_text_en], to: :es) - .exactly(1) - .times - .and_return(response_end_text) + .exactly(1) + .times + .and_return(response_end_text) start_another_text_en = Faker::Lorem.characters(number: 12) + "." end_another_text_en = Faker::Lorem.characters(number: 12) @@ -81,13 +81,13 @@ describe RemoteTranslations::Microsoft::Client do response_another_end_text = [another_end_translated_text_es] expect_any_instance_of(BingTranslator).to receive(:translate_array).with([start_another_text_en], to: :es) - .exactly(1) - .times - .and_return(response_another_start_text) + .exactly(1) + .times + .and_return(response_another_start_text) expect_any_instance_of(BingTranslator).to receive(:translate_array).with([end_another_text_en], to: :es) - .exactly(1) - .times - .and_return(response_another_end_text) + .exactly(1) + .times + .and_return(response_another_end_text) result = client.call([text_en, another_text_en], :es) diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index f98c86172..e5302665b 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -101,23 +101,23 @@ describe Comment do it "expires cache when the author is hidden" do expect { comment.user.hide } - .to change { [comment.reload.cache_version, comment.author.cache_version] } + .to change { [comment.reload.cache_version, comment.author.cache_version] } end it "expires cache when the author is erased" do expect { comment.user.erase } - .to change { [comment.reload.cache_version, comment.author.cache_version] } + .to change { [comment.reload.cache_version, comment.author.cache_version] } end it "expires cache when the author changes" do expect { comment.user.update(username: "Isabel") } - .to change { [comment.reload.cache_version, comment.author.cache_version] } + .to change { [comment.reload.cache_version, comment.author.cache_version] } end it "expires cache when the author's organization get verified" do create(:organization, user: comment.user) expect { comment.user.organization.verify } - .to change { [comment.reload.cache_version, comment.author.cache_version] } + .to change { [comment.reload.cache_version, comment.author.cache_version] } end end diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb index 4b5564955..68270198d 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -376,23 +376,23 @@ describe Debate do it "expires cache when the author is hidden" do expect { debate.author.hide } - .to change { [debate.reload.cache_version, debate.author.cache_version] } + .to change { [debate.reload.cache_version, debate.author.cache_version] } end it "expires cache when the author is erased" do expect { debate.author.erase } - .to change { [debate.reload.cache_version, debate.author.cache_version] } + .to change { [debate.reload.cache_version, debate.author.cache_version] } end it "expires cache when its author changes" do expect { debate.author.update(username: "Eva") } - .to change { [debate.reload.cache_version, debate.author.cache_version] } + .to change { [debate.reload.cache_version, debate.author.cache_version] } end it "expires cache when the author's organization get verified" do create(:organization, user: debate.author) expect { debate.author.organization.verify } - .to change { [debate.reload.cache_version, debate.author.cache_version] } + .to change { [debate.reload.cache_version, debate.author.cache_version] } end end diff --git a/spec/models/legislation/process_spec.rb b/spec/models/legislation/process_spec.rb index 60e8e8236..dde6408b2 100644 --- a/spec/models/legislation/process_spec.rb +++ b/spec/models/legislation/process_spec.rb @@ -181,7 +181,7 @@ describe Legislation::Process do debate_end_date: Date.current - 1.day) expect(process).to be_invalid expect(process.errors.messages[:debate_end_date]) - .to include("must be on or after the debate start date") + .to include("must be on or after the debate start date") end it "is valid if draft_end_date is the same as draft_start_date" do @@ -195,7 +195,7 @@ describe Legislation::Process do draft_end_date: Date.current - 1.day) expect(process).to be_invalid expect(process.errors.messages[:draft_end_date]) - .to include("must be on or after the draft start date") + .to include("must be on or after the draft start date") end it "is invalid if allegations_end_date is before allegations_start_date" do @@ -203,7 +203,7 @@ describe Legislation::Process do allegations_end_date: Date.current - 1.day) expect(process).to be_invalid expect(process.errors.messages[:allegations_end_date]) - .to include("must be on or after the comments start date") + .to include("must be on or after the comments start date") end it "is valid if allegations_end_date is the same as allegations_start_date" do diff --git a/spec/models/local_census_records/import_spec.rb b/spec/models/local_census_records/import_spec.rb index b763c13c7..67a04cdf6 100644 --- a/spec/models/local_census_records/import_spec.rb +++ b/spec/models/local_census_records/import_spec.rb @@ -81,7 +81,7 @@ describe LocalCensusRecords::Import do expect(import.invalid_records.map(&:date_of_birth)) .to eq(invalid_records_date_of_births) expect(import.invalid_records.map(&:postal_code)) - .to eq(invalid_records_postal_codes) + .to eq(invalid_records_postal_codes) end end end diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index 48c5cf0ca..abb152549 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -427,23 +427,23 @@ describe Proposal do it "expires cache when the author is hidden" do expect { proposal.author.hide } - .to change { [proposal.reload.cache_version, proposal.author.cache_version] } + .to change { [proposal.reload.cache_version, proposal.author.cache_version] } end it "expires cache when the author is erased" do expect { proposal.author.erase } - .to change { [proposal.reload.cache_version, proposal.author.cache_version] } + .to change { [proposal.reload.cache_version, proposal.author.cache_version] } end it "expires cache when its author changes" do expect { proposal.author.update(username: "Eva") } - .to change { [proposal.reload.cache_version, proposal.author.cache_version] } + .to change { [proposal.reload.cache_version, proposal.author.cache_version] } end it "expires cache when the author's organization get verified" do create(:organization, user: proposal.author) expect { proposal.author.organization.verify } - .to change { [proposal.reload.cache_version, proposal.author.cache_version] } + .to change { [proposal.reload.cache_version, proposal.author.cache_version] } end end diff --git a/spec/shared/system/remotely_translatable.rb b/spec/shared/system/remotely_translatable.rb index 21e0c661e..87eb15533 100644 --- a/spec/shared/system/remotely_translatable.rb +++ b/spec/shared/system/remotely_translatable.rb @@ -10,8 +10,9 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume before do Setting["feature.remote_translations"] = true available_locales_response = %w[de en es fr pt zh-Hans] - expect(RemoteTranslations::Microsoft::AvailableLocales).to receive(:available_locales).at_most(4).times - .and_return(available_locales_response) + expect(RemoteTranslations::Microsoft::AvailableLocales) + .to receive(:available_locales).at_most(4).times + .and_return(available_locales_response) allow(Rails.application.secrets).to receive(:microsoft_api_key).and_return("123") end diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 95c3c4e47..ea415fa61 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -36,7 +36,7 @@ module CommonActions def validate_officer allow_any_instance_of(Officing::BaseController) - .to receive(:verify_officer_assignment).and_return(true) + .to receive(:verify_officer_assignment).and_return(true) end def fill_in_proposal @@ -70,7 +70,7 @@ module CommonActions booth = create(:poll_booth) if booth.blank? allow_any_instance_of(Officing::BaseController) - .to receive(:current_booth).and_return(booth) + .to receive(:current_booth).and_return(booth) end def click_sdg_goal(code) diff --git a/spec/system/admin/site_customization/information_texts_spec.rb b/spec/system/admin/site_customization/information_texts_spec.rb index c8855c09c..1c085bc67 100644 --- a/spec/system/admin/site_customization/information_texts_spec.rb +++ b/spec/system/admin/site_customization/information_texts_spec.rb @@ -56,7 +56,7 @@ describe "Admin custom information texts", :admin do within("#information-texts-tabs") { click_link "Proposals" } expect(find("a[href=\"/admin/site_customization/information_texts?tab=proposals\"].is-active")) - .to have_content "Proposals" + .to have_content "Proposals" end context "Globalization" do diff --git a/spec/system/budgets/votes_spec.rb b/spec/system/budgets/votes_spec.rb index 15c5d4caa..f180dbb98 100644 --- a/spec/system/budgets/votes_spec.rb +++ b/spec/system/budgets/votes_spec.rb @@ -149,7 +149,7 @@ describe "Votes" do participation = find(".participation-not-allowed") headings = participation.text - .match(/You have already supported investments in (.+) and (.+)\./)&.captures + .match(/You have already supported investments in (.+) and (.+)\./)&.captures expect(headings).to match_array [new_york.name, san_francisco.name] @@ -183,7 +183,7 @@ describe "Votes" do participation = find(".participation-not-allowed") headings = participation.text - .match(/You have already supported investments in (.+) and (.+)\./)&.captures + .match(/You have already supported investments in (.+) and (.+)\./)&.captures expect(headings).to match_array [new_york.name, san_francisco.name] diff --git a/spec/system/management/document_verifications_spec.rb b/spec/system/management/document_verifications_spec.rb index efb72664b..0549066cb 100644 --- a/spec/system/management/document_verifications_spec.rb +++ b/spec/system/management/document_verifications_spec.rb @@ -32,8 +32,9 @@ describe "DocumentVerifications" do describe "Verifying througth Census" do context "Census API" do scenario "Verifying a user which does not exist and is not in the census shows an error" do - expect_any_instance_of(Verification::Management::Document).to receive(:in_census?) - .and_return(false) + expect_any_instance_of(Verification::Management::Document) + .to receive(:in_census?) + .and_return(false) login_as_manager visit management_document_verifications_path @@ -55,8 +56,9 @@ describe "DocumentVerifications" do context "Remote Census API", :remote_census do scenario "Verifying a user which does not exist and is not in the census shows an error" do - expect_any_instance_of(Verification::Management::Document).to receive(:in_census?) - .and_return(false) + expect_any_instance_of(Verification::Management::Document) + .to receive(:in_census?) + .and_return(false) login_as_manager visit management_document_verifications_path From 1a098dfcab0243837d9f5f726e4c0b28d22bfe7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 1 Jul 2023 18:18:22 +0200 Subject: [PATCH 08/13] Add and apply MultilineMethodCallBraceLayout rule In order for this rule to work effectively when running `--autocorrect`, we also need to enable the `ClosingParenthesisIndentation` rule. --- .rubocop.yml | 6 ++++++ .../budgets/investments/form_component.html.erb | 3 +-- .../budgets/investments/my_ballot_component.html.erb | 3 ++- app/components/debates/form_component.html.erb | 3 +-- app/components/proposals/form_component.html.erb | 3 +-- app/controllers/admin/budgets_controller.rb | 3 ++- app/models/comment.rb | 3 ++- app/models/organization.rb | 6 ++++-- app/models/user.rb | 3 ++- app/views/admin/officials/search.html.erb | 2 +- app/views/layouts/application.html.erb | 3 +-- app/views/legislation/proposals/_form.html.erb | 3 +-- app/views/legislation/proposals/_proposal.html.erb | 3 ++- app/views/mailer/budget_investment_created.html.erb | 3 ++- app/views/mailer/budget_investment_unfeasible.html.erb | 3 ++- app/views/mailer/comment.html.erb | 3 ++- app/views/mailer/direct_message_for_receiver.html.erb | 6 ++++-- app/views/mailer/email_verification.html.erb | 6 ++++-- app/views/mailer/evaluation_comment.html.erb | 3 +-- app/views/mailer/newsletter.html.erb | 3 ++- app/views/mailer/proposal_notification_digest.html.erb | 8 +++++--- app/views/mailer/reply.html.erb | 3 ++- app/views/organizations/registrations/new.html.erb | 3 +-- app/views/polls/_advanced_stats.html.erb | 3 ++- app/views/users/registrations/new.html.erb | 6 +++--- app/views/verification/residence/new.html.erb | 6 +++--- spec/components/sdg/tag_list_component_spec.rb | 3 +-- .../sdg/targets/plain_tag_list_component_spec.rb | 3 +-- spec/components/sdg/targets/tag_list_component_spec.rb | 3 +-- spec/components/shared/banner_component_spec.rb | 9 +++------ spec/models/budget/stats_spec.rb | 3 +-- spec/models/geozone_spec.rb | 3 ++- spec/system/admin/budget_investments_spec.rb | 6 ++---- spec/system/emails_spec.rb | 3 ++- spec/system/legislation/processes_spec.rb | 3 +-- spec/system/legislation/summary_spec.rb | 3 +-- 36 files changed, 74 insertions(+), 65 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index b0b25095f..7d16caa06 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -30,6 +30,9 @@ Layout/AssignmentIndentation: Layout/ClosingHeredocIndentation: Enabled: true +Layout/ClosingParenthesisIndentation: + Enabled: true + Layout/DotPosition: Enabled: true @@ -108,6 +111,9 @@ Layout/MultilineHashBraceLayout: Layout/MultilineHashKeyLineBreaks: Enabled: true +Layout/MultilineMethodCallBraceLayout: + Enabled: true + Layout/MultilineMethodCallIndentation: Enabled: true diff --git a/app/components/budgets/investments/form_component.html.erb b/app/components/budgets/investments/form_component.html.erb index 9b28cb0ed..daa0aec4a 100644 --- a/app/components/budgets/investments/form_component.html.erb +++ b/app/components/budgets/investments/form_component.html.erb @@ -97,8 +97,7 @@ title: t("form.accept_terms_title"), label: t("form.accept_terms", policy: link_to(t("form.policy"), "/privacy", target: "blank"), - conditions: link_to(t("form.conditions"), "/conditions", target: "blank") - ) %> + conditions: link_to(t("form.conditions"), "/conditions", target: "blank")) %>
    <% end %> diff --git a/app/components/budgets/investments/my_ballot_component.html.erb b/app/components/budgets/investments/my_ballot_component.html.erb index bf141f63e..307be97cc 100644 --- a/app/components/budgets/investments/my_ballot_component.html.erb +++ b/app/components/budgets/investments/my_ballot_component.html.erb @@ -25,7 +25,8 @@

    <%= sanitize(ballot.change_vote_info( link: link_to(t("budgets.investments.index.sidebar.change_vote_link"), - budget_ballot_path(budget)))) %> + budget_ballot_path(budget)) + )) %>

      diff --git a/app/components/debates/form_component.html.erb b/app/components/debates/form_component.html.erb index 3733960cd..851269d1b 100644 --- a/app/components/debates/form_component.html.erb +++ b/app/components/debates/form_component.html.erb @@ -45,8 +45,7 @@ title: t("form.accept_terms_title"), label: t("form.accept_terms", policy: link_to(t("form.policy"), "/privacy", target: "blank"), - conditions: link_to(t("form.conditions"), "/conditions", target: "blank") - ) %> + conditions: link_to(t("form.conditions"), "/conditions", target: "blank")) %>
    <% end %> diff --git a/app/components/proposals/form_component.html.erb b/app/components/proposals/form_component.html.erb index 5a99d7e37..f6084f3b8 100644 --- a/app/components/proposals/form_component.html.erb +++ b/app/components/proposals/form_component.html.erb @@ -104,8 +104,7 @@ title: t("form.accept_terms_title"), label: t("form.accept_terms", policy: link_to(t("form.policy"), "/privacy", target: "blank"), - conditions: link_to(t("form.conditions"), "/conditions", target: "blank") - ) %> + conditions: link_to(t("form.conditions"), "/conditions", target: "blank")) %>
    <% end %> diff --git a/app/controllers/admin/budgets_controller.rb b/app/controllers/admin/budgets_controller.rb index 6ce7b2721..c0facf84b 100644 --- a/app/controllers/admin/budgets_controller.rb +++ b/app/controllers/admin/budgets_controller.rb @@ -29,7 +29,8 @@ class Admin::BudgetsController < Admin::BaseController @budget.headings.each { |heading| Budget::Result.new(@budget, heading).delay.calculate_winners } redirect_to admin_budget_budget_investments_path( budget_id: @budget.id, - advanced_filters: ["winners"]), + advanced_filters: ["winners"] + ), notice: I18n.t("admin.budgets.winners.calculated") end diff --git a/app/models/comment.rb b/app/models/comment.rb index 762f1bdef..cad1bf8fe 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -148,7 +148,8 @@ class Comment < ApplicationRecord def validate_body_length validator = ActiveModel::Validations::LengthValidator.new( attributes: :body, - maximum: Comment.body_max_length) + maximum: Comment.body_max_length + ) validator.validate(self) end diff --git a/app/models/organization.rb b/app/models/organization.rb index 62b510a4d..436521fd4 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -52,14 +52,16 @@ class Organization < ApplicationRecord def validate_name_length validator = ActiveModel::Validations::LengthValidator.new( attributes: :name, - maximum: Organization.name_max_length) + maximum: Organization.name_max_length + ) validator.validate(self) end def validate_responsible_name_length validator = ActiveModel::Validations::LengthValidator.new( attributes: :responsible_name, - maximum: Organization.responsible_name_max_length) + maximum: Organization.responsible_name_max_length + ) validator.validate(self) end end diff --git a/app/models/user.rb b/app/models/user.rb index 881ace74e..ecc2833e8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -427,7 +427,8 @@ class User < ApplicationRecord def validate_username_length validator = ActiveModel::Validations::LengthValidator.new( attributes: :username, - maximum: User.username_max_length) + maximum: User.username_max_length + ) validator.validate(self) end end diff --git a/app/views/admin/officials/search.html.erb b/app/views/admin/officials/search.html.erb index 5e361d9e7..8c5d8d013 100644 --- a/app/views/admin/officials/search.html.erb +++ b/app/views/admin/officials/search.html.erb @@ -37,7 +37,7 @@ actions: [:edit], edit_path: edit_admin_official_path(user), edit_text: (t("admin.officials.search.make_official") unless user.official?) - ) %> + ) %> <% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index eb84e2688..8cdffdce9 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -35,8 +35,7 @@ firefox: link_to(t("layouts.application.firefox"), "https://www.mozilla.org/firefox", title: t("shared.target_blank"), - target: "_blank") - )) %> + target: "_blank"))) %>

    diff --git a/app/views/legislation/proposals/_form.html.erb b/app/views/legislation/proposals/_form.html.erb index 8d9760c08..7fa3d3a4b 100644 --- a/app/views/legislation/proposals/_form.html.erb +++ b/app/views/legislation/proposals/_form.html.erb @@ -66,8 +66,7 @@ title: t("form.accept_terms_title"), label: t("form.accept_terms", policy: link_to(t("form.policy"), "/privacy", target: "blank"), - conditions: link_to(t("form.conditions"), "/conditions", target: "blank") - ) %> + conditions: link_to(t("form.conditions"), "/conditions", target: "blank")) %> <% end %>
    diff --git a/app/views/legislation/proposals/_proposal.html.erb b/app/views/legislation/proposals/_proposal.html.erb index 5537fbba5..a2a985f44 100644 --- a/app/views/legislation/proposals/_proposal.html.erb +++ b/app/views/legislation/proposals/_proposal.html.erb @@ -26,7 +26,8 @@ url: legislation_process_proposal_path( proposal.legislation_process_id, proposal, - anchor: "comments") + anchor: "comments" + ) ) %> <% if proposal.author.hidden? || proposal.author.erased? %> diff --git a/app/views/mailer/budget_investment_created.html.erb b/app/views/mailer/budget_investment_created.html.erb index 12f945b41..7c0c1c8e6 100644 --- a/app/views/mailer/budget_investment_created.html.erb +++ b/app/views/mailer/budget_investment_created.html.erb @@ -20,7 +20,8 @@

    <%= sanitize( - t("mailers.budget_investment_created.follow", + t( + "mailers.budget_investment_created.follow", link: link_to(t("mailers.budget_investment_created.follow_link"), budgets_url, style: css_for_mailer_link) diff --git a/app/views/mailer/budget_investment_unfeasible.html.erb b/app/views/mailer/budget_investment_unfeasible.html.erb index 0fd60982d..444861672 100644 --- a/app/views/mailer/budget_investment_unfeasible.html.erb +++ b/app/views/mailer/budget_investment_unfeasible.html.erb @@ -14,7 +14,8 @@

    <%= sanitize( - t("mailers.budget_investment_unfeasible.new", + t( + "mailers.budget_investment_unfeasible.new", url: link_to(t("mailers.budget_investment_unfeasible.new_href"), new_budget_investment_url(@investment.budget), style: css_for_mailer_link) diff --git a/app/views/mailer/comment.html.erb b/app/views/mailer/comment.html.erb index 3c277bbd8..3121e2ce3 100644 --- a/app/views/mailer/comment.html.erb +++ b/app/views/mailer/comment.html.erb @@ -19,7 +19,8 @@

    <%= sanitize( - t("mailers.config.unsubscribe_text", + t( + "mailers.config.unsubscribe_text", notifications: link_to( t("mailers.config.notifications_link"), edit_subscriptions_url(token: @token), diff --git a/app/views/mailer/direct_message_for_receiver.html.erb b/app/views/mailer/direct_message_for_receiver.html.erb index 33c64f941..5a8799607 100644 --- a/app/views/mailer/direct_message_for_receiver.html.erb +++ b/app/views/mailer/direct_message_for_receiver.html.erb @@ -22,11 +22,13 @@

    <%= sanitize( - t("mailers.direct_message_for_receiver.unsubscribe_text", + t( + "mailers.direct_message_for_receiver.unsubscribe_text", notifications: link_to( t("mailers.config.notifications_link"), edit_subscriptions_url(token: @token), - style: css_for_mailer_link) + style: css_for_mailer_link + ) ), attributes: %w[href style] ) %> diff --git a/app/views/mailer/email_verification.html.erb b/app/views/mailer/email_verification.html.erb index fe1525a3f..d4305d77e 100644 --- a/app/views/mailer/email_verification.html.erb +++ b/app/views/mailer/email_verification.html.erb @@ -10,11 +10,13 @@

    <%= sanitize( - t("mailers.email_verification.instructions", + t( + "mailers.email_verification.instructions", verification_link: link_to( t("mailers.email_verification.click_here_to_verify"), email_url(email_verification_token: @token), - style: css_for_mailer_link) + style: css_for_mailer_link + ) ), attributes: %w[href style] ) %> diff --git a/app/views/mailer/evaluation_comment.html.erb b/app/views/mailer/evaluation_comment.html.erb index fa95263ed..c1ae1b0eb 100644 --- a/app/views/mailer/evaluation_comment.html.erb +++ b/app/views/mailer/evaluation_comment.html.erb @@ -12,8 +12,7 @@ <%= sanitize( t("mailers.evaluation_comment.new_comment_by", commenter: @email.comment.author.name, - investment: valuation_comments_link(@email.commentable) - ) + investment: valuation_comments_link(@email.commentable)) ) %>

    diff --git a/app/views/mailer/newsletter.html.erb b/app/views/mailer/newsletter.html.erb index 7b7d5130d..8c6c3dfee 100644 --- a/app/views/mailer/newsletter.html.erb +++ b/app/views/mailer/newsletter.html.erb @@ -6,7 +6,8 @@

    <%= sanitize( - t("mailers.config.unsubscribe_text", + t( + "mailers.config.unsubscribe_text", notifications: link_to( t("mailers.config.notifications_link"), edit_subscriptions_url(token: @token), diff --git a/app/views/mailer/proposal_notification_digest.html.erb b/app/views/mailer/proposal_notification_digest.html.erb index fee371793..bc2620d37 100644 --- a/app/views/mailer/proposal_notification_digest.html.erb +++ b/app/views/mailer/proposal_notification_digest.html.erb @@ -64,12 +64,14 @@

    <%= sanitize( - t("mailers.proposal_notification_digest.unsubscribe_text", + t( + "mailers.proposal_notification_digest.unsubscribe_text", notifications: link_to( t("mailers.config.notifications_link"), edit_subscriptions_url(token: @token), - style: css_for_mailer_link) - ), + style: css_for_mailer_link + ) + ), attributes: %w[href style] ) %>

    diff --git a/app/views/mailer/reply.html.erb b/app/views/mailer/reply.html.erb index c25fcb1bc..2af83667a 100644 --- a/app/views/mailer/reply.html.erb +++ b/app/views/mailer/reply.html.erb @@ -19,7 +19,8 @@

    <%= sanitize( - t("mailers.config.unsubscribe_text", + t( + "mailers.config.unsubscribe_text", notifications: link_to( t("mailers.config.notifications_link"), edit_subscriptions_url(token: @token), diff --git a/app/views/organizations/registrations/new.html.erb b/app/views/organizations/registrations/new.html.erb index 09b462f6d..b36fba601 100644 --- a/app/views/organizations/registrations/new.html.erb +++ b/app/views/organizations/registrations/new.html.erb @@ -30,8 +30,7 @@ terms: link_to(t("devise_views.users.registrations.new.terms_link"), "/conditions", title: t("shared.target_blank"), - target: "_blank") - ) %> + target: "_blank")) %>

    <%= f.submit t("devise_views.organizations.registrations.new.submit"), class: "button expanded" %> diff --git a/app/views/polls/_advanced_stats.html.erb b/app/views/polls/_advanced_stats.html.erb index 5b66db75a..7bfd0f06f 100644 --- a/app/views/polls/_advanced_stats.html.erb +++ b/app/views/polls/_advanced_stats.html.erb @@ -7,7 +7,8 @@ <% stats.channels.each do |channel| %> <%= number_with_info_tags( stats.send("total_participants_#{channel}"), - t("stats.polls.#{channel}_percentage", + t( + "stats.polls.#{channel}_percentage", percentage: number_to_stats_percentage(stats.send(:"total_participants_#{channel}_percentage")) ), html_class: channel diff --git a/app/views/users/registrations/new.html.erb b/app/views/users/registrations/new.html.erb index 6f028e199..0afca1696 100644 --- a/app/views/users/registrations/new.html.erb +++ b/app/views/users/registrations/new.html.erb @@ -37,10 +37,10 @@ <%= f.check_box :terms_of_service, title: t("devise_views.users.registrations.new.terms_title"), label: t("devise_views.users.registrations.new.terms", - terms: link_to(t("devise_views.users.registrations.new.terms_link"), "/conditions", + terms: link_to(t("devise_views.users.registrations.new.terms_link"), + "/conditions", title: t("shared.target_blank"), - target: "_blank") - ) %> + target: "_blank")) %>
    <%= f.submit t("devise_views.users.registrations.new.submit"), class: "button expanded" %> diff --git a/app/views/verification/residence/new.html.erb b/app/views/verification/residence/new.html.erb index e62e890f4..b528598f9 100644 --- a/app/views/verification/residence/new.html.erb +++ b/app/views/verification/residence/new.html.erb @@ -71,10 +71,10 @@ <%= f.check_box :terms_of_service, title: t("verification.residence.new.accept_terms_text_title"), label: t("verification.residence.new.accept_terms_text", - terms_url: link_to(t("verification.residence.new.terms"), page_path("census_terms"), + terms_url: link_to(t("verification.residence.new.terms"), + page_path("census_terms"), title: t("shared.target_blank"), - target: "_blank") - ) %> + target: "_blank")) %>
    diff --git a/spec/components/sdg/tag_list_component_spec.rb b/spec/components/sdg/tag_list_component_spec.rb index 1139ae6ef..cc43c0c0e 100644 --- a/spec/components/sdg/tag_list_component_spec.rb +++ b/spec/components/sdg/tag_list_component_spec.rb @@ -4,8 +4,7 @@ describe SDG::TagListComponent do let(:debate) do create(:debate, sdg_goals: [SDG::Goal[3]], - sdg_targets: [SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")] - ) + sdg_targets: [SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")]) end let(:component) { SDG::TagListComponent.new(debate) } diff --git a/spec/components/sdg/targets/plain_tag_list_component_spec.rb b/spec/components/sdg/targets/plain_tag_list_component_spec.rb index 04bd08cad..722bfdb3f 100644 --- a/spec/components/sdg/targets/plain_tag_list_component_spec.rb +++ b/spec/components/sdg/targets/plain_tag_list_component_spec.rb @@ -3,8 +3,7 @@ require "rails_helper" describe SDG::Targets::PlainTagListComponent do let(:debate) do create(:debate, - sdg_targets: [SDG::Target[1.1], SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")] - ) + sdg_targets: [SDG::Target[1.1], SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")]) end let(:component) { SDG::Targets::PlainTagListComponent.new(debate) } diff --git a/spec/components/sdg/targets/tag_list_component_spec.rb b/spec/components/sdg/targets/tag_list_component_spec.rb index b2dcf1146..5ae7f7b89 100644 --- a/spec/components/sdg/targets/tag_list_component_spec.rb +++ b/spec/components/sdg/targets/tag_list_component_spec.rb @@ -3,8 +3,7 @@ require "rails_helper" describe SDG::Targets::TagListComponent do let(:debate) do create(:debate, - sdg_targets: [SDG::Target[1.1], SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")] - ) + sdg_targets: [SDG::Target[1.1], SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")]) end let(:component) { SDG::Targets::TagListComponent.new(debate) } diff --git a/spec/components/shared/banner_component_spec.rb b/spec/components/shared/banner_component_spec.rb index 0d3436329..ef36de26a 100644 --- a/spec/components/shared/banner_component_spec.rb +++ b/spec/components/shared/banner_component_spec.rb @@ -9,8 +9,7 @@ describe Shared::BannerComponent do post_started_at: (Date.current - 4.days), post_ended_at: (Date.current + 10.days), background_color: "#FF0000", - font_color: "#FFFFFF" - ) + font_color: "#FFFFFF") render_inline Shared::BannerComponent.new(banner) @@ -38,15 +37,13 @@ describe Shared::BannerComponent do web_sections: [WebSection.find_by!(name: "debates")], title: "First banner", description: "First description", - target_url: "/first_target" - ) + target_url: "/first_target") create(:banner, web_sections: [WebSection.find_by!(name: "debates")], title: "Second banner", description: "Second description", - target_url: "/second_target" - ) + target_url: "/second_target") end it "only renders one banner" do diff --git a/spec/models/budget/stats_spec.rb b/spec/models/budget/stats_spec.rb index d59ef6e7c..476969876 100644 --- a/spec/models/budget/stats_spec.rb +++ b/spec/models/budget/stats_spec.rb @@ -77,8 +77,7 @@ describe Budget::Stats do it "doesn't count nil user ids" do create(:budget_ballot_line, investment: investment, - ballot: create(:budget_ballot, budget: budget.reload, user: nil, physical: true) - ) + ballot: create(:budget_ballot, budget: budget.reload, user: nil, physical: true)) expect(stats.total_participants_vote_phase).to be 0 end diff --git a/spec/models/geozone_spec.rb b/spec/models/geozone_spec.rb index 65c269610..c2b441f10 100644 --- a/spec/models/geozone_spec.rb +++ b/spec/models/geozone_spec.rb @@ -73,7 +73,8 @@ describe Geozone do expect(geozone.outline_points).to eq( [[-3.9259027239257, 40.8792937308316], [-3.9249047078766, 40.8788966596619], - [-3.9247799675785, 40.8789131852224]]) + [-3.9247799675785, 40.8789131852224]] + ) end end end diff --git a/spec/system/admin/budget_investments_spec.rb b/spec/system/admin/budget_investments_spec.rb index 1f1514990..3002ae987 100644 --- a/spec/system/admin/budget_investments_spec.rb +++ b/spec/system/admin/budget_investments_spec.rb @@ -937,8 +937,7 @@ describe "Admin budget investments", :admin do price: 1234, price_first_year: 1000, administrator: administrator, - valuators: [valuator] - ) + valuators: [valuator]) visit admin_budget_budget_investments_path(budget_investment.budget) @@ -1757,8 +1756,7 @@ describe "Admin budget investments", :admin do :winner, :visible_to_valuators, budget: budget, - author: create(:user, username: "Jon Doe") - ) + author: create(:user, username: "Jon Doe")) end let(:default_columns) do %w[id title supports admin valuator geozone feasibility price diff --git a/spec/system/emails_spec.rb b/spec/system/emails_spec.rb index a439921b7..38f1ea940 100644 --- a/spec/system/emails_spec.rb +++ b/spec/system/emails_spec.rb @@ -496,7 +496,8 @@ describe "Emails" do expect(email.body.encoded).to include("This is a different body") expect(email).to have_body_text("To unsubscribe from these emails, visit") expect(email).to have_body_text( - edit_subscriptions_path(token: user_with_newsletter_in_segment_2.subscriptions_token)) + edit_subscriptions_path(token: user_with_newsletter_in_segment_2.subscriptions_token) + ) expect(email).to have_body_text('and uncheck "Receive relevant information by email"') end end diff --git a/spec/system/legislation/processes_spec.rb b/spec/system/legislation/processes_spec.rb index a0b2829d1..6540ae3e5 100644 --- a/spec/system/legislation/processes_spec.rb +++ b/spec/system/legislation/processes_spec.rb @@ -401,8 +401,7 @@ describe "Legislation" do create(:milestone, milestoneable: process, description: "Something important happened", - publication_date: Date.new(2018, 3, 22) - ) + publication_date: Date.new(2018, 3, 22)) visit legislation_process_path(process) diff --git a/spec/system/legislation/summary_spec.rb b/spec/system/legislation/summary_spec.rb index 5bab2d84d..37618b9e1 100644 --- a/spec/system/legislation/summary_spec.rb +++ b/spec/system/legislation/summary_spec.rb @@ -22,8 +22,7 @@ describe "Legislation" do scenario "empty process" do process = create(:legislation_process, :empty, result_publication_enabled: true, - end_date: Date.current - 1.day - ) + end_date: Date.current - 1.day) visit summary_legislation_process_path(process) From 30befbc08aaf5d3e3f6913b4cd84b077bb12c6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 18 Jul 2023 13:17:57 +0200 Subject: [PATCH 09/13] Remove obsolete code about banner images and styles We forgot to remove it in commit 8066b96fe. We're removing it now because these methods didn't follow the Layout/BlockAlignment rubocop rule, which we're about to add. --- app/controllers/admin/banners_controller.rb | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/app/controllers/admin/banners_controller.rb b/app/controllers/admin/banners_controller.rb index c795b4b33..72b085a5d 100644 --- a/app/controllers/admin/banners_controller.rb +++ b/app/controllers/admin/banners_controller.rb @@ -47,18 +47,6 @@ class Admin::BannersController < Admin::BaseController web_section_ids: []] end - def banner_styles - @banner_styles = Setting.all.banner_style.map do |banner_style| - [banner_style.value, banner_style.key.split(".")[1]] - end - end - - def banner_imgs - @banner_imgs = Setting.all.banner_img.map do |banner_img| - [banner_img.value, banner_img.key.split(".")[1]] - end - end - def banner_sections @banner_sections = WebSection.all end From f5c2a3d4ef7bf34ae8db4e2b2bd83c22a5d2c555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 1 Jul 2023 18:49:34 +0200 Subject: [PATCH 10/13] Add and apply BlockAlignment rubocop rule This will make it easier to run rubocop with `--autocorrect` when dealing with the LineLength rule. --- .rubocop.yml | 3 +++ db/dev_seeds.rb | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 7d16caa06..3ff4c8d67 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -27,6 +27,9 @@ Layout/ArrayAlignment: Layout/AssignmentIndentation: Enabled: true +Layout/BlockAlignment: + Enabled: true + Layout/ClosingHeredocIndentation: Enabled: true diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb index 05250b78c..00f102f22 100644 --- a/db/dev_seeds.rb +++ b/db/dev_seeds.rb @@ -5,8 +5,8 @@ end @logger = Logger.new(STDOUT) @logger.formatter = proc do |_severity, _datetime, _progname, msg| - msg unless Rails.env.test? - end + msg unless Rails.env.test? +end def load_dev_seeds(dev_seeds_file) load Rails.root.join("db", "dev_seeds", "#{dev_seeds_file}.rb") From 96a0aa2a881d3c08e9d05327a8658d5a9b71d14b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 18 Jul 2023 03:23:27 +0200 Subject: [PATCH 11/13] Add and apply LineContinuationSpacing rubocop rule So now we're consistent when separating multiline strings. --- .rubocop.yml | 3 + db/dev_seeds/geozones.rb | 20 +-- db/dev_seeds/newsletters.rb | 12 +- db/dev_seeds/settings.rb | 2 +- ...2233844_create_shared_extensions_schema.rb | 2 +- .../budgets/budget_component_spec.rb | 4 +- spec/mailers/dashboard/mailer_spec.rb | 68 +++++----- spec/models/legislation/annotation_spec.rb | 118 +++++++++--------- spec/system/account_spec.rb | 6 +- spec/system/admin/administrators_spec.rb | 2 +- spec/system/admin/budget_investments_spec.rb | 14 +-- spec/system/admin/budget_phases_spec.rb | 4 +- spec/system/admin/budgets_spec.rb | 10 +- .../system/admin/local_census_records_spec.rb | 2 +- spec/system/admin/machine_learning_spec.rb | 12 +- spec/system/admin/system_emails_spec.rb | 2 +- spec/system/budgets/investments_spec.rb | 10 +- spec/system/budgets/votes_spec.rb | 22 ++-- .../budget_investments_valuation_spec.rb | 2 +- spec/system/dashboard/dashboard_spec.rb | 10 +- spec/system/proposal_notifications_spec.rb | 14 +-- .../sdg_management/local_targets_spec.rb | 2 +- spec/system/users_auth_spec.rb | 10 +- spec/system/verification/letter_spec.rb | 2 +- .../level_three_verification_spec.rb | 2 +- 25 files changed, 179 insertions(+), 176 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 3ff4c8d67..380ba4ace 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -95,6 +95,9 @@ Layout/IndentationWidth: Layout/LeadingEmptyLines: Enabled: true +Layout/LineContinuationSpacing: + Enabled: true + Layout/LineEndStringConcatenationIndentation: Enabled: true diff --git a/db/dev_seeds/geozones.rb b/db/dev_seeds/geozones.rb index 98d75d137..d608435d0 100644 --- a/db/dev_seeds/geozones.rb +++ b/db/dev_seeds/geozones.rb @@ -1,24 +1,24 @@ section "Creating Geozones" do Geozone.create!(name: I18n.t("seeds.geozones.north_district"), external_code: "001", census_code: "01", - html_map_coordinates: "30,139,45,153,77,148,107,165,138,201,146,218,186,198,216,"\ - "196,233,203,240,215,283,194,329,185,377,184,388,165,369,126,333,113,334,84,320,"\ + html_map_coordinates: "30,139,45,153,77,148,107,165,138,201,146,218,186,198,216," \ + "196,233,203,240,215,283,194,329,185,377,184,388,165,369,126,333,113,334,84,320," \ "66,286,73,258,65,265,57,249,47,207,58,159,84,108,85,72,101,51,114") Geozone.create!(name: I18n.t("seeds.geozones.west_district"), external_code: "002", census_code: "02", - html_map_coordinates: "42,153,31,176,24,202,20,221,44,235,59,249,55,320,30,354,"\ - "31,372,52,396,64,432,89,453,116,432,149,419,162,412,165,377,172,357,189,352,228,"\ - "327,246,313,262,297,234,291,210,284,193,284,176,294,158,303,154,310,146,289,140,"\ + html_map_coordinates: "42,153,31,176,24,202,20,221,44,235,59,249,55,320,30,354," \ + "31,372,52,396,64,432,89,453,116,432,149,419,162,412,165,377,172,357,189,352,228," \ + "327,246,313,262,297,234,291,210,284,193,284,176,294,158,303,154,310,146,289,140," \ "268,138,246,135,236,139,222,151,214,136,197,120,179,99,159,85,149,65,149,56,149") Geozone.create!(name: I18n.t("seeds.geozones.east_district"), external_code: "003", census_code: "03", - html_map_coordinates: "175,353,162,378,161,407,153,416,167,432,184,447,225,426,"\ - "250,409,283,390,298,369,344,363,351,334,356,296,361,267,376,245,378,185,327,188,"\ - "281,195,239,216,245,221,245,232,261,244,281,238,300,242,304,251,285,262,278,277,"\ + html_map_coordinates: "175,353,162,378,161,407,153,416,167,432,184,447,225,426," \ + "250,409,283,390,298,369,344,363,351,334,356,296,361,267,376,245,378,185,327,188," \ + "281,195,239,216,245,221,245,232,261,244,281,238,300,242,304,251,285,262,278,277," \ "267,294,249,312,219,333,198,346,184,353") Geozone.create!(name: I18n.t("seeds.geozones.central_district"), external_code: "004", census_code: "04", - html_map_coordinates: "152,308,137,258,133,235,147,216,152,214,186,194,210,196,"\ - "228,202,240,216,241,232,263,243,293,241,301,245,302,254,286,265,274,278,267,296,"\ + html_map_coordinates: "152,308,137,258,133,235,147,216,152,214,186,194,210,196," \ + "228,202,240,216,241,232,263,243,293,241,301,245,302,254,286,265,274,278,267,296," \ "243,293,226,289,209,285,195,283,177,297") end diff --git a/db/dev_seeds/newsletters.rb b/db/dev_seeds/newsletters.rb index e196f8a0a..46fb4d4aa 100644 --- a/db/dev_seeds/newsletters.rb +++ b/db/dev_seeds/newsletters.rb @@ -1,13 +1,13 @@ section "Creating Newsletters" do newsletter_body = [ - "We choose to go to the moon in this decade and do the other things, not because they are easy"\ - ", but because they are hard, because that goal will serve to organize and measure the best of"\ - " our energies and skills, because that challenge is one that we are willing to accept, one we"\ + "We choose to go to the moon in this decade and do the other things, not because they are easy" \ + ", but because they are hard, because that goal will serve to organize and measure the best of" \ + " our energies and skills, because that challenge is one that we are willing to accept, one we" \ " are unwilling to postpone, and one which we intend to win.", - "Spaceflights cannot be stopped. This is not the work of any one man or even a group of men."\ - " It is a historical process which mankind is carrying out in accordance with the natural laws"\ + "Spaceflights cannot be stopped. This is not the work of any one man or even a group of men." \ + " It is a historical process which mankind is carrying out in accordance with the natural laws" \ " of human development.", - "Many say exploration is part of our destiny, but it’s actually our duty to future generations"\ + "Many say exploration is part of our destiny, but it’s actually our duty to future generations" \ " and their quest to ensure the survival of the human species." ] diff --git a/db/dev_seeds/settings.rb b/db/dev_seeds/settings.rb index 66f179337..1dba17c6d 100644 --- a/db/dev_seeds/settings.rb +++ b/db/dev_seeds/settings.rb @@ -6,7 +6,7 @@ section "Creating Settings" do "feature.featured_proposals": "true", "feature.map": "true", "instagram_handle": "CONSUL DEMOCRACY", - "meta_description": "Citizen participation tool for an open, "\ + "meta_description": "Citizen participation tool for an open, " \ "transparent and democratic government", "meta_keywords": "citizen participation, open government", "meta_title": "CONSUL DEMOCRACY", diff --git a/db/migrate/20200602233844_create_shared_extensions_schema.rb b/db/migrate/20200602233844_create_shared_extensions_schema.rb index 9c34019b6..41c5db2ec 100644 --- a/db/migrate/20200602233844_create_shared_extensions_schema.rb +++ b/db/migrate/20200602233844_create_shared_extensions_schema.rb @@ -66,7 +66,7 @@ class CreateSharedExtensionsSchema < ActiveRecord::Migration[6.0] execute statement else log_warning( - "GRANT CREATE ON DATABASE #{query_value("SELECT CURRENT_DATABASE()")} "\ + "GRANT CREATE ON DATABASE #{query_value("SELECT CURRENT_DATABASE()")} " \ "TO #{query_value("SELECT CURRENT_USER")}" ) log_warning(statement) diff --git a/spec/components/budgets/budget_component_spec.rb b/spec/components/budgets/budget_component_spec.rb index bbbe4de33..0119c9330 100644 --- a/spec/components/budgets/budget_component_spec.rb +++ b/spec/components/budgets/budget_component_spec.rb @@ -61,7 +61,7 @@ describe Budgets::BudgetComponent do render_inline Budgets::BudgetComponent.new(budget) expect(page).to have_css ".budget-header.with-background-image" - expect(page).to have_css ".budget-header[style*='background-image:']"\ + expect(page).to have_css ".budget-header[style*='background-image:']" \ "[style*='url(\\''][style*='clippy(with_brackets).jpg\\'']" end @@ -71,7 +71,7 @@ describe Budgets::BudgetComponent do render_inline Budgets::BudgetComponent.new(budget) expect(page).to have_css ".budget-header.with-background-image" - expect(page).to have_css ".budget-header[style*='background-image:']"\ + expect(page).to have_css ".budget-header[style*='background-image:']" \ "[style*='url(\\''][style*='clippy_with_\\\\\'quotes\\\\\'.jpg']" end end diff --git a/spec/mailers/dashboard/mailer_spec.rb b/spec/mailers/dashboard/mailer_spec.rb index 5cc59d23c..c3515c00a 100644 --- a/spec/mailers/dashboard/mailer_spec.rb +++ b/spec/mailers/dashboard/mailer_spec.rb @@ -73,36 +73,36 @@ describe Dashboard::Mailer do expect(email).to deliver_to(proposal.author) expect(email).to have_subject("Your draft citizen proposal is created") expect(email).to have_body_text("Hi #{proposal.author.name}!") - expect(email).to have_body_text("Your #{proposal.title} proposal has been "\ + expect(email).to have_body_text("Your #{proposal.title} proposal has been " \ "successfully created.") - expect(email).to have_body_text("Take advantage that your proposal is not public yet and "\ + expect(email).to have_body_text("Take advantage that your proposal is not public yet and " \ "get ready to contact a lot of people.") expect(email).to have_body_text("When you are ready publish your citizen proposal from this") expect(email).to have_link "link", href: proposal_dashboard_url(proposal) - expect(email).to have_body_text("We know that creating a proposal with a hook and getting "\ - "the necessary support can seem complicated. But don't "\ + expect(email).to have_body_text("We know that creating a proposal with a hook and getting " \ + "the necessary support can seem complicated. But don't " \ "worry because we are going to help you!") - expect(email).to have_body_text("You have a tool that will be your new best ally: "\ + expect(email).to have_body_text("You have a tool that will be your new best ally: " \ "The Citizen Proposals panel.") - expect(email).to have_body_text("Enter every day in the panel of your proposal to use the "\ + expect(email).to have_body_text("Enter every day in the panel of your proposal to use the " \ "tips and resources that we will share with you.") - expect(email).to have_body_text("These tips, actions and resources will give you ideas and "\ - "also practical solutions to get more support and a wider "\ + expect(email).to have_body_text("These tips, actions and resources will give you ideas and " \ + "also practical solutions to get more support and a wider " \ "community. Dont forget them!") - expect(email).to have_body_text("As you gain more support, you will unlock new and better "\ - "resources. At the moment, you have an e-mail template to "\ - "send massively to all your contacts, a poster to print, "\ - "among other features and rewards that you will discover. "\ - "Dont stop adding support and we will not stop rewarding "\ + expect(email).to have_body_text("As you gain more support, you will unlock new and better " \ + "resources. At the moment, you have an e-mail template to " \ + "send massively to all your contacts, a poster to print, " \ + "among other features and rewards that you will discover. " \ + "Dont stop adding support and we will not stop rewarding " \ "and helping you!") - expect(email).to have_body_text("You have #{Setting["months_to_archive_proposals"]} months "\ - "since you publish the proposal to get "\ - "#{Setting["votes_for_proposal_success"]} support and your "\ - "proposal can become a reality. But the first days are the "\ + expect(email).to have_body_text("You have #{Setting["months_to_archive_proposals"]} months " \ + "since you publish the proposal to get " \ + "#{Setting["votes_for_proposal_success"]} support and your " \ + "proposal can become a reality. But the first days are the " \ "most important. It is a challenge. Get ready!") expect(email).to have_body_text("And for you to start with all the motivation,") - expect(email).to have_body_text("here you have several resources and a whole list of "\ - "tips that will come to you every day to prepare the "\ + expect(email).to have_body_text("here you have several resources and a whole list of " \ + "tips that will come to you every day to prepare the " \ "broadcast!") expect(email).to have_body_text("Go ahead, discover them!") end @@ -135,33 +135,33 @@ describe Dashboard::Mailer do expect(email).to deliver_from("CONSUL ") expect(email).to deliver_to(proposal.author) - expect(email).to have_subject("Your citizen proposal is already "\ + expect(email).to have_subject("Your citizen proposal is already " \ "published. Don't stop spreading!") - expect(email).to have_body_text("Congratulations #{proposal.author.name}! Your proposal "\ + expect(email).to have_body_text("Congratulations #{proposal.author.name}! Your proposal " \ "#{proposal.title} has been created successfully.") expect(email).to have_body_text("And now, go for your first 100 supports!") expect(email).to have_body_text("Why 100?") - expect(email).to have_body_text("Our experience tells us that the first day is fundamental. "\ - "Because in addition to having the energy to launch "\ - "something new, being a newly published proposal, you will "\ - "have the important visibility of being among the new "\ + expect(email).to have_body_text("Our experience tells us that the first day is fundamental. " \ + "Because in addition to having the energy to launch " \ + "something new, being a newly published proposal, you will " \ + "have the important visibility of being among the new " \ "proposals highlighted.") - expect(email).to have_body_text("Get 100 supports on the first day, and you will have "\ + expect(email).to have_body_text("Get 100 supports on the first day, and you will have " \ "a first community to back you up.") - expect(email).to have_body_text("That is why we challenge you to get it, but not without "\ + expect(email).to have_body_text("That is why we challenge you to get it, but not without " \ "a lot of help!") - expect(email).to have_body_text("Remember that in your Proposal Panel you have new "\ - "resources available and recommendations for "\ + expect(email).to have_body_text("Remember that in your Proposal Panel you have new " \ + "resources available and recommendations for " \ "dissemination actions.") - expect(email).to have_body_text("Come in every day to see your progress and use the tips "\ - "and resources we will share with you. They are ideas and "\ + expect(email).to have_body_text("Come in every day to see your progress and use the tips " \ + "and resources we will share with you. They are ideas and " \ "also practical solutions to get the support you need.") - expect(email).to have_body_text("As you get more support, you will unlock new and better "\ - "resources. Do not stop adding support and we will not stop "\ + expect(email).to have_body_text("As you get more support, you will unlock new and better " \ + "resources. Do not stop adding support and we will not stop " \ "rewarding and helping you!") expect(email).to have_body_text("And for you to start at full speed...") expect(email).to have_body_text("Here is a great resource at your disposal!") - expect(email).to have_body_text("You will also find this new recommended dissemination "\ + expect(email).to have_body_text("You will also find this new recommended dissemination " \ "action...") expect(email).to have_body_text("You sure have more resources to use!") expect(email).to have_body_text("Go ahead, discover them!") diff --git a/spec/models/legislation/annotation_spec.rb b/spec/models/legislation/annotation_spec.rb index b06d55696..f0ac81a2e 100644 --- a/spec/models/legislation/annotation_spec.rb +++ b/spec/models/legislation/annotation_spec.rb @@ -10,16 +10,16 @@ RSpec.describe Legislation::Annotation, type: :model do end it "calculates the context for multinode annotations" do - quote = "ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam"\ - " erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex"\ - " ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum"\ - " dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril"\ - " delenit augue duis dolore te feugait nulla facilisi."\ - "\n\n"\ - "Expetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi"\ - " tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis"\ - " ea. Per ne impedit iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id."\ - "\n\n"\ + quote = "ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam" \ + " erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex" \ + " ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum" \ + " dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril" \ + " delenit augue duis dolore te feugait nulla facilisi." \ + "\n\n" \ + "Expetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi" \ + " tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis" \ + " ea. Per ne impedit iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id." \ + "\n\n" \ "His audiam" annotation = create( :legislation_annotation, @@ -28,24 +28,24 @@ RSpec.describe Legislation::Annotation, type: :model do ranges: [{ "start" => "/p[1]", "startOffset" => 6, "end" => "/p[3]", "endOffset" => 11 }] ) - context = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt"\ - " ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper"\ - " suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit"\ - " esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui"\ - " blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\n\nExpetenda tincidunt in sed, ex"\ - " partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi tincidunt, omnium virtute"\ - " aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis ea. Per ne impedit"\ - " iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id.\n\nHis audiamdeserunt in, eum"\ - " ubique voluptatibus te. In reque dicta usu. Ne rebum dissentiet eam, vim omnis deseruisse id. Ullum deleniti vituperata at"\ - " quo, insolens complectitur te eos, ea pri dico munere propriae. Vel ferri facilis ut, qui paulo ridens praesent ad. Possim"\ + context = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt" \ + " ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper" \ + " suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit" \ + " esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui" \ + " blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\n\nExpetenda tincidunt in sed, ex" \ + " partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi tincidunt, omnium virtute" \ + " aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis ea. Per ne impedit" \ + " iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id.\n\nHis audiamdeserunt in, eum" \ + " ubique voluptatibus te. In reque dicta usu. Ne rebum dissentiet eam, vim omnis deseruisse id. Ullum deleniti vituperata at" \ + " quo, insolens complectitur te eos, ea pri dico munere propriae. Vel ferri facilis ut, qui paulo ridens praesent ad. Possim" \ " alterum qui cu. Accusamus consulatu ius te, cu decore soleat appareat usu." expect(annotation.context).to eq(context) end it "calculates the context for multinode annotations 2" do - quote = "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla"\ - " facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore"\ - " te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant"\ + quote = "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla" \ + " facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore" \ + " te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex partem placerat sea, porro commodo ex eam. His putant" \ " aeterno interesset at. Usu ea mundi tincidunt, omnium virtute aliquando ius ex. Ea aperiri sententiae duo" annotation = create( :legislation_annotation, @@ -54,44 +54,44 @@ RSpec.describe Legislation::Annotation, type: :model do ranges: [{ "start" => "/p[1]", "startOffset" => 273, "end" => "/p[2]", "endOffset" => 190 }] ) - context = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna"\ - " aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut"\ - " aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit"\ - " esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui"\ - " blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex"\ - " partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi tincidunt, omnium virtute"\ - " aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis ea. Per ne impedit"\ + context = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna" \ + " aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut" \ + " aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit" \ + " esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui" \ + " blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\r\n\r\nExpetenda tincidunt in sed, ex" \ + " partem placerat sea, porro commodo ex eam. His putant aeterno interesset at. Usu ea mundi tincidunt, omnium virtute" \ + " aliquando ius ex. Ea aperiri sententiae duo. Usu nullam dolorum quaestio ei, sit vidit facilisis ea. Per ne impedit" \ " iracundia neglegentur. Consetetur neglegentur eum ut, vis animal legimus inimicus id." expect(annotation.context).to eq(context) end it "calculates the context for multinode annotations 3" do - body = "The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed"\ - " to ensure cooperation with the community in the case of network server software.\r\n\r\nThe licenses for most software and"\ - " other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public"\ - " Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free"\ - " software for all its users.\r\n\r\nWhen we speak of free software, we are referring to freedom, not price. Our General"\ - " Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for"\ - " them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces"\ - " of it in new free programs, and that you know you can do these things.\r\n\r\nDevelopers that use our General Public Licenses"\ - " protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you"\ - " legal permission to copy, distribute and/or modify the software.\r\n\r\nA secondary benefit of defending all users' freedom"\ - " is that improvements made in alternate versions of the program, if they receive widespread use, become available for other"\ - " developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation."\ - " However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License"\ - " permits making a modified version and letting the public access it on a server without ever releasing its source code to the"\ - " public.\r\n\r\nThe GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified"\ - " source code becomes available to the community. It requires the operator of a network server to provide the source code of"\ - " the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly"\ - " accessible server, gives the public access to the source code of the modified version.\r\n\r\nAn older license, called the"\ - " Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license,"\ - " not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this"\ + body = "The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed" \ + " to ensure cooperation with the community in the case of network server software.\r\n\r\nThe licenses for most software and" \ + " other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public" \ + " Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free" \ + " software for all its users.\r\n\r\nWhen we speak of free software, we are referring to freedom, not price. Our General" \ + " Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for" \ + " them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces" \ + " of it in new free programs, and that you know you can do these things.\r\n\r\nDevelopers that use our General Public Licenses" \ + " protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you" \ + " legal permission to copy, distribute and/or modify the software.\r\n\r\nA secondary benefit of defending all users' freedom" \ + " is that improvements made in alternate versions of the program, if they receive widespread use, become available for other" \ + " developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation." \ + " However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License" \ + " permits making a modified version and letting the public access it on a server without ever releasing its source code to the" \ + " public.\r\n\r\nThe GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified" \ + " source code becomes available to the community. It requires the operator of a network server to provide the source code of" \ + " the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly" \ + " accessible server, gives the public access to the source code of the modified version.\r\n\r\nAn older license, called the" \ + " Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license," \ + " not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this" \ " license." draft_version = create(:legislation_draft_version, body: body) - quote = "By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a"\ - " program--to make sure it remains free software for all its users.\r\n\r\nWhen we speak of free software, we are referring to"\ - " freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of"\ + quote = "By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a" \ + " program--to make sure it remains free software for all its users.\r\n\r\nWhen we speak of free software, we are referring to" \ + " freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of" \ " free software (and charge for them if you wish)" annotation = create( @@ -101,12 +101,12 @@ RSpec.describe Legislation::Annotation, type: :model do ranges: [{ "start" => "/p[2]", "startOffset" => 127, "end" => "/p[3]", "endOffset" => 223 }] ) - context = "The licenses for most software and other practical works are designed to take away your freedom to share and change the"\ - " works. By contrast, our General Public Licenses are intended to guarantee your freedom to share"\ - " and change all versions of a program--to make sure it remains free software for all its users.\r\n\r\nWhen we speak of"\ - " free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have"\ - " the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code"\ - " or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know"\ + context = "The licenses for most software and other practical works are designed to take away your freedom to share and change the" \ + " works. By contrast, our General Public Licenses are intended to guarantee your freedom to share" \ + " and change all versions of a program--to make sure it remains free software for all its users.\r\n\r\nWhen we speak of" \ + " free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have" \ + " the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code" \ + " or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know" \ " you can do these things." expect(annotation.context).to eq(context) diff --git a/spec/system/account_spec.rb b/spec/system/account_spec.rb index 2d368a1d6..1e96fc6a8 100644 --- a/spec/system/account_spec.rb +++ b/spec/system/account_spec.rb @@ -61,9 +61,9 @@ describe "Account" do click_button "Update" - notice = "Your account has been updated successfully;"\ - " however, we need to verify your new email address."\ - " Please check your email and click on the link to"\ + notice = "Your account has been updated successfully;" \ + " however, we need to verify your new email address." \ + " Please check your email and click on the link to" \ " complete the confirmation of your new email address." expect(page).to have_content notice diff --git a/spec/system/admin/administrators_spec.rb b/spec/system/admin/administrators_spec.rb index 10f355938..2c7ba525f 100644 --- a/spec/system/admin/administrators_spec.rb +++ b/spec/system/admin/administrators_spec.rb @@ -35,7 +35,7 @@ describe "Admin administrators" do scenario "Delete Administrator" do visit admin_administrators_path - confirmation = "Are you sure? This action will delete "\ + confirmation = "Are you sure? This action will delete " \ "\"#{user_administrator.name}\" and can't be undone." within "#administrator_#{user_administrator.id}" do diff --git a/spec/system/admin/budget_investments_spec.rb b/spec/system/admin/budget_investments_spec.rb index 3002ae987..43c0f16d0 100644 --- a/spec/system/admin/budget_investments_spec.rb +++ b/spec/system/admin/budget_investments_spec.rb @@ -535,7 +535,7 @@ describe "Admin budget investments", :admin do click_button "Filter" expect(page).not_to have_button "Calculate Winner Investments" - expect(page).to have_content 'The budget has to stay on phase "Reviewing voting" '\ + expect(page).to have_content 'The budget has to stay on phase "Reviewing voting" ' \ "in order to calculate winners projects" visit admin_budget_path(budget) @@ -1720,12 +1720,12 @@ describe "Admin budget investments", :admin do expect(header).to match(/^attachment/) expect(header).to match(/filename="budget_investments.csv"/) - csv_contents = "ID,Title,Supports,Administrator,Valuator,Valuation Group,Scope of operation,"\ - "Feasibility,Val. Fin.,Selected,Show to valuators,Author username\n"\ - "#{first_investment.id},Le Investment,88,Admin,-,Valuator Group,"\ - "Budget Heading,Feasible (€99),Yes,Yes,Yes,"\ - "#{first_investment.author.username}\n#{second_investment.id},"\ - "Alt Investment,66,No admin assigned,Valuator,-,Other Heading,"\ + csv_contents = "ID,Title,Supports,Administrator,Valuator,Valuation Group,Scope of operation," \ + "Feasibility,Val. Fin.,Selected,Show to valuators,Author username\n" \ + "#{first_investment.id},Le Investment,88,Admin,-,Valuator Group," \ + "Budget Heading,Feasible (€99),Yes,Yes,Yes," \ + "#{first_investment.author.username}\n#{second_investment.id}," \ + "Alt Investment,66,No admin assigned,Valuator,-,Other Heading," \ "Unfeasible,No,No,No,#{second_investment.author.username}\n" expect(page.body).to eq(csv_contents) diff --git a/spec/system/admin/budget_phases_spec.rb b/spec/system/admin/budget_phases_spec.rb index 528285740..efc2638e1 100644 --- a/spec/system/admin/budget_phases_spec.rb +++ b/spec/system/admin/budget_phases_spec.rb @@ -7,8 +7,8 @@ describe "Admin budget phases" do scenario "Update phase" do visit edit_admin_budget_budget_phase_path(budget, budget.current_phase) - expect(page).to have_content "These fields are used for information purposes only and do not trigger "\ - "an automatic update of the active phase. In order to update it, edit "\ + expect(page).to have_content "These fields are used for information purposes only and do not trigger " \ + "an automatic update of the active phase. In order to update it, edit " \ "the budget and select the active phase." expect(page).to have_content "For information purposes only" diff --git a/spec/system/admin/budgets_spec.rb b/spec/system/admin/budgets_spec.rb index f1c0c67f6..7d1fb85e7 100644 --- a/spec/system/admin/budgets_spec.rb +++ b/spec/system/admin/budgets_spec.rb @@ -235,8 +235,8 @@ describe "Admin budgets", :admin do visit admin_budget_path(budget) - expect(page).to have_content "The configuration of these phases is used for information purposes "\ - "only. Its function is to define the phases information displayed "\ + expect(page).to have_content "The configuration of these phases is used for information purposes " \ + "only. Its function is to define the phases information displayed " \ "on the public page of the participatory budget." expect(page).to have_table "Phases", with_cols: [ [ @@ -357,7 +357,7 @@ describe "Admin budgets", :admin do scenario "Change voting style uncheck hide money" do budget_hide_money = create(:budget, :approval, :hide_money) - hide_money_help_text = "If this option is checked, all fields showing the amount of money "\ + hide_money_help_text = "If this option is checked, all fields showing the amount of money " \ "will be hidden throughout the process." visit edit_admin_budget_path(budget_hide_money) @@ -378,7 +378,7 @@ describe "Admin budgets", :admin do scenario "Edit knapsack budget do not show hide money info" do budget = create(:budget, :knapsack) - hide_money_help_text = "If this option is checked, all fields showing the amount of money "\ + hide_money_help_text = "If this option is checked, all fields showing the amount of money " \ "will be hidden throughout the process." visit edit_admin_budget_path(budget) @@ -394,7 +394,7 @@ describe "Admin budgets", :admin do scenario "Edit approval budget show hide money info" do budget = create(:budget, :approval) - hide_money_help_text = "If this option is checked, all fields showing the amount of money "\ + hide_money_help_text = "If this option is checked, all fields showing the amount of money " \ "will be hidden throughout the process." visit edit_admin_budget_path(budget) diff --git a/spec/system/admin/local_census_records_spec.rb b/spec/system/admin/local_census_records_spec.rb index cf30393b6..d88083705 100644 --- a/spec/system/admin/local_census_records_spec.rb +++ b/spec/system/admin/local_census_records_spec.rb @@ -139,7 +139,7 @@ describe "Admin local census records", :admin do expect(page).to have_content deleted_document_number - confirmation = "Are you sure? This action will delete "\ + confirmation = "Are you sure? This action will delete " \ "\"#{local_census_record.title}\" and can't be undone." accept_confirm(confirmation) { click_on "Delete" } diff --git a/spec/system/admin/machine_learning_spec.rb b/spec/system/admin/machine_learning_spec.rb index d058f8eb9..f7f4606e8 100644 --- a/spec/system/admin/machine_learning_spec.rb +++ b/spec/system/admin/machine_learning_spec.rb @@ -40,7 +40,7 @@ describe "Machine learning" do visit admin_machine_learning_path - expect(page).to have_content "This feature is disabled. To use Machine Learning you can enable it from "\ + expect(page).to have_content "This feature is disabled. To use Machine Learning you can enable it from " \ "the settings page" expect(page).to have_link "settings page", href: admin_settings_path(anchor: "tab-feature-flags") end @@ -56,7 +56,7 @@ describe "Machine learning" do click_button "Execute script" expect(page).to have_content "The last script has been executed successfully." - expect(page).to have_content "You will receive an email in #{admin.email} when the script "\ + expect(page).to have_content "You will receive an email in #{admin.email} when the script " \ "finishes running." expect(page).to have_field "Select python script to execute" @@ -71,11 +71,11 @@ describe "Machine learning" do end expect(page).to have_content "Related content" - expect(page).to have_content "Adds automatically generated related content to proposals and "\ + expect(page).to have_content "Adds automatically generated related content to proposals and " \ "participatory budget projects" expect(page).to have_content "Comments summary" - expect(page).to have_content "Displays an automatically generated comment summary on all items that "\ + expect(page).to have_content "Displays an automatically generated comment summary on all items that " \ "can be commented on." expect(page).to have_content "Tags" @@ -94,7 +94,7 @@ describe "Machine learning" do select "proposals_related_content_and_tags_nmf.py", from: "Select python script to execute" click_button "Execute script" - expect(page).to have_content "The script is running. The administrator who executed it will receive "\ + expect(page).to have_content "The script is running. The administrator who executed it will receive " \ "an email when it is finished." expect(page).to have_content "Executed by: #{admin.name}" @@ -139,7 +139,7 @@ describe "Machine learning" do expect(page).to have_content "Script name: proposals_related_content_and_tags_nmf.py" expect(page).to have_content "Error: Error description" - expect(page).to have_content "You will receive an email in #{admin.email} when the script "\ + expect(page).to have_content "You will receive an email in #{admin.email} when the script " \ "finishes running." expect(page).to have_field "Select python script to execute" diff --git a/spec/system/admin/system_emails_spec.rb b/spec/system/admin/system_emails_spec.rb index 27b094b1f..a2786207b 100644 --- a/spec/system/admin/system_emails_spec.rb +++ b/spec/system/admin/system_emails_spec.rb @@ -267,7 +267,7 @@ describe "System Emails" do expect(page).to have_content "New evaluation comment for Cleaner city" expect(page).to have_content "Hi #{admin.name}" - expect(page).to have_content "There is a new evaluation comment from #{comment.user.name} "\ + expect(page).to have_content "There is a new evaluation comment from #{comment.user.name} " \ "to the budget investment Cleaner city" expect(page).to have_content comment.body diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb index 917b60f36..c48f9425e 100644 --- a/spec/system/budgets/investments_spec.rb +++ b/spec/system/budgets/investments_spec.rb @@ -603,7 +603,7 @@ describe "Budget Investments" do fill_in_new_investment_title with: "Build a skyscraper" fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds" fill_in "Location additional info", with: "City center" - fill_in "If you are proposing in the name of a collective/organization, "\ + fill_in "If you are proposing in the name of a collective/organization, " \ "or on behalf of more people, write its name", with: "T.I.A." fill_in "Tags", with: "Towers" check "I agree to the Privacy Policy and the Terms and conditions of use" @@ -668,7 +668,7 @@ describe "Budget Investments" do fill_in_new_investment_title with: "Build a skyscraper" fill_in_ckeditor "Description", with: "I want to live in a high tower over the clouds" fill_in "Location additional info", with: "City center" - fill_in "If you are proposing in the name of a collective/organization, "\ + fill_in "If you are proposing in the name of a collective/organization, " \ "or on behalf of more people, write its name", with: "T.I.A." fill_in "Tags", with: "Towers" check "I agree to the Privacy Policy and the Terms and conditions of use" @@ -1000,14 +1000,14 @@ describe "Budget Investments" do expect(page).not_to have_content("Unfeasibility explanation") expect(page).not_to have_content("Local government is not competent in this") - expect(page).not_to have_content("This investment project has been marked as not feasible "\ + expect(page).not_to have_content("This investment project has been marked as not feasible " \ "and will not go to balloting phase") visit budget_investment_path(budget, id: investment_2.id) expect(page).to have_content("Unfeasibility explanation") expect(page).to have_content("The unfeasible explanation") - expect(page).to have_content("This investment project has been marked as not feasible "\ + expect(page).to have_content("This investment project has been marked as not feasible " \ "and will not go to balloting phase") end @@ -1472,7 +1472,7 @@ describe "Budget Investments" do visit budget_ballot_path(budget) - expect(page).to have_content "But you can change your vote at any time "\ + expect(page).to have_content "But you can change your vote at any time " \ "until this phase is closed." within("#budget_group_#{global_group.id}") do diff --git a/spec/system/budgets/votes_spec.rb b/spec/system/budgets/votes_spec.rb index f180dbb98..9d38b47b6 100644 --- a/spec/system/budgets/votes_spec.rb +++ b/spec/system/budgets/votes_spec.rb @@ -20,17 +20,17 @@ describe "Votes" do within("#budget-investments") do within("#budget_investment_#{investment1.id}_votes") do - expect(page).to have_content "You have already supported this investment project. "\ + expect(page).to have_content "You have already supported this investment project. " \ "Share it!" end within("#budget_investment_#{investment2.id}_votes") do - expect(page).not_to have_content "You have already supported this investment project. "\ + expect(page).not_to have_content "You have already supported this investment project. " \ "Share it!" end within("#budget_investment_#{investment3.id}_votes") do - expect(page).not_to have_content "You have already supported this investment project. "\ + expect(page).not_to have_content "You have already supported this investment project. " \ "Share it!" end end @@ -45,7 +45,7 @@ describe "Votes" do click_button "Support" expect(page).to have_content "1 support" - expect(page).to have_content "You have already supported this investment project. "\ + expect(page).to have_content "You have already supported this investment project. " \ "Share it!" end end @@ -77,7 +77,7 @@ describe "Votes" do click_button "Support" expect(page).to have_content "1 support" - expect(page).to have_content "You have already supported this investment project. "\ + expect(page).to have_content "You have already supported this investment project. " \ "Share it!" end end @@ -123,7 +123,7 @@ describe "Votes" do accept_confirm { click_button "Support" } expect(page).to have_content "1 support" - expect(page).to have_content "You have already supported this investment project. "\ + expect(page).to have_content "You have already supported this investment project. " \ "Share it!" end @@ -135,7 +135,7 @@ describe "Votes" do click_button "Support" expect(page).to have_content "1 support" - expect(page).to have_content "You have already supported this investment project. "\ + expect(page).to have_content "You have already supported this investment project. " \ "Share it!" end @@ -144,7 +144,7 @@ describe "Votes" do within("#budget_investment_#{third_heading_investment.id}") do click_button "Support" - expect(page).to have_content "You can only support investment projects in 2 districts. "\ + expect(page).to have_content "You can only support investment projects in 2 districts. " \ "You have already supported investments in" participation = find(".participation-not-allowed") @@ -154,7 +154,7 @@ describe "Votes" do expect(headings).to match_array [new_york.name, san_francisco.name] expect(page).not_to have_content "1 support" - expect(page).not_to have_content "You have already supported this investment project. "\ + expect(page).not_to have_content "You have already supported this investment project. " \ "Share it!" end end @@ -178,7 +178,7 @@ describe "Votes" do click_button "Support" - expect(page).to have_content "You can only support investment projects in 2 districts. "\ + expect(page).to have_content "You can only support investment projects in 2 districts. " \ "You have already supported investments in" participation = find(".participation-not-allowed") @@ -188,7 +188,7 @@ describe "Votes" do expect(headings).to match_array [new_york.name, san_francisco.name] expect(page).not_to have_content "1 support" - expect(page).not_to have_content "You have already supported this investment project. "\ + expect(page).not_to have_content "You have already supported this investment project. " \ "Share it!" end diff --git a/spec/system/comments/budget_investments_valuation_spec.rb b/spec/system/comments/budget_investments_valuation_spec.rb index 47d9823cc..1dc008483 100644 --- a/spec/system/comments/budget_investments_valuation_spec.rb +++ b/spec/system/comments/budget_investments_valuation_spec.rb @@ -130,7 +130,7 @@ describe "Internal valuation comments on Budget::Investments" do end scenario "Sanitizes comment body for security" do - comment_with_js = " "\ + comment_with_js = " " \ "click me http://www.url.com" create(:comment, :valuation, author: admin_user, commentable: investment, body: comment_with_js) diff --git a/spec/system/dashboard/dashboard_spec.rb b/spec/system/dashboard/dashboard_spec.rb index 58b8f9d4f..6eb79dbb2 100644 --- a/spec/system/dashboard/dashboard_spec.rb +++ b/spec/system/dashboard/dashboard_spec.rb @@ -58,9 +58,9 @@ describe "Proposal's dashboard" do scenario "Dashboard progress show proposed actions truncated description" do action = create(:dashboard_action, :proposed_action, :active, description: "One short action") action_long = create(:dashboard_action, :proposed_action, :active, - description: "This is a really very long description for a proposed "\ - "action on progress dashboard section, so this description "\ - "should be appear truncated and shows the show description "\ + description: "This is a really very long description for a proposed " \ + "action on progress dashboard section, so this description " \ + "should be appear truncated and shows the show description " \ "link to show the complete description to the users.") visit progress_proposal_dashboard_path(proposal) @@ -273,7 +273,7 @@ describe "Proposal's dashboard" do click_link(feature.title) click_button "Request" - expect(page).to have_content("The request has been successfully sent. We will contact you "\ + expect(page).to have_content("The request has been successfully sent. We will contact you " \ "as soon as possible to inform you about it.") end @@ -298,7 +298,7 @@ describe "Proposal's dashboard" do end click_button "Request" - expect(page).to have_content("The request has been successfully sent. We will contact you "\ + expect(page).to have_content("The request has been successfully sent. We will contact you " \ "as soon as possible to inform you about it.") end diff --git a/spec/system/proposal_notifications_spec.rb b/spec/system/proposal_notifications_spec.rb index e3dba91ab..53f763de7 100644 --- a/spec/system/proposal_notifications_spec.rb +++ b/spec/system/proposal_notifications_spec.rb @@ -17,7 +17,7 @@ describe "Proposal Notifications" do click_link "Send notification to proposal followers" fill_in "proposal_notification_title", with: "Thank you for supporting my proposal" - fill_in "proposal_notification_body", with: "Please share it with "\ + fill_in "proposal_notification_body", with: "Please share it with " \ "others so we can make it happen!" click_button "Send notification" @@ -104,7 +104,7 @@ describe "Proposal Notifications" do login_as(author) visit new_proposal_notification_path(proposal_id: proposal.id) - expect(page).to have_content "This notification will be sent to 7 people and it will "\ + expect(page).to have_content "This notification will be sent to 7 people and it will " \ "be visible in the proposal's page" expect(page).to have_link("the proposal's page", href: proposal_path(proposal, anchor: "comments")) @@ -120,7 +120,7 @@ describe "Proposal Notifications" do login_as(author) visit new_proposal_notification_path(proposal_id: proposal.id) - expect(page).to have_content "This notification will be sent to 7 people and it will "\ + expect(page).to have_content "This notification will be sent to 7 people and it will " \ "be visible in the proposal's page" expect(page).to have_link("the proposal's page", href: proposal_path(proposal, anchor: "comments")) @@ -135,7 +135,7 @@ describe "Proposal Notifications" do login_as(author) visit new_proposal_notification_path(proposal_id: proposal.id) - expect(page).to have_content "This notification will be sent to 1 people and it will "\ + expect(page).to have_content "This notification will be sent to 1 people and it will " \ "be visible in the proposal's page" expect(page).to have_link("the proposal's page", href: proposal_path(proposal, anchor: "comments")) @@ -190,7 +190,7 @@ describe "Proposal Notifications" do visit new_proposal_notification_path(proposal_id: proposal.id) fill_in "proposal_notification_title", with: "Thank you for supporting my proposal" - fill_in "proposal_notification_body", with: "Please share it with "\ + fill_in "proposal_notification_body", with: "Please share it with " \ "others so we can make it happen!" click_button "Send notification" @@ -242,7 +242,7 @@ describe "Proposal Notifications" do visit new_proposal_notification_path(proposal_id: proposal.id) fill_in "proposal_notification_title", with: "Thank you for supporting my proposal" - fill_in "proposal_notification_body", with: "Please share it with "\ + fill_in "proposal_notification_body", with: "Please share it with " \ "others so we can make it happen!" click_button "Send notification" @@ -292,7 +292,7 @@ describe "Proposal Notifications" do visit new_proposal_notification_path(proposal_id: proposal.id) fill_in "proposal_notification_title", with: "Thank you for supporting my proposal" - fill_in "proposal_notification_body", with: "Please share it with "\ + fill_in "proposal_notification_body", with: "Please share it with " \ "others so we can make it happen!" click_button "Send notification" diff --git a/spec/system/sdg_management/local_targets_spec.rb b/spec/system/sdg_management/local_targets_spec.rb index 77d5e6065..ea1da65fc 100644 --- a/spec/system/sdg_management/local_targets_spec.rb +++ b/spec/system/sdg_management/local_targets_spec.rb @@ -89,7 +89,7 @@ describe "Local Targets" do sdg_local_target = create(:sdg_local_target, code: "1.1.1") visit sdg_management_local_targets_path - confirmation = "Are you sure? This action will delete "\ + confirmation = "Are you sure? This action will delete " \ "\"#{sdg_local_target.title}\" and can't be undone." accept_confirm(confirmation) { click_button "Delete" } diff --git a/spec/system/users_auth_spec.rb b/spec/system/users_auth_spec.rb index 646cd3716..9257a70e2 100644 --- a/spec/system/users_auth_spec.rb +++ b/spec/system/users_auth_spec.rb @@ -611,7 +611,7 @@ describe "Users" do fill_in "Email", with: "manuela@consul.dev" click_button "Send instructions" - expect(page).to have_content "If your email address is in our database, in a few minutes "\ + expect(page).to have_content "If your email address is in our database, in a few minutes " \ "you will receive a link to use to reset your password." action_mailer = ActionMailer::Base.deliveries.last.body.to_s @@ -633,7 +633,7 @@ describe "Users" do fill_in "Email", with: "fake@mail.dev" click_button "Send instructions" - expect(page).to have_content "If your email address is in our database, in a few minutes "\ + expect(page).to have_content "If your email address is in our database, in a few minutes " \ "you will receive a link to use to reset your password." end @@ -648,7 +648,7 @@ describe "Users" do fill_in "Email", with: "manuela@consul.dev" click_button "Re-send instructions" - expect(page).to have_content "If your email address exists in our database, in a few minutes you will "\ + expect(page).to have_content "If your email address exists in our database, in a few minutes you will " \ "receive an email with instructions on how to confirm your email address." expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first.to).to eq(["manuela@consul.dev"]) @@ -664,7 +664,7 @@ describe "Users" do fill_in "Email", with: "fake@mail.dev" click_button "Re-send instructions" - expect(page).to have_content "If your email address exists in our database, in a few minutes you will "\ + expect(page).to have_content "If your email address exists in our database, in a few minutes you will " \ "receive an email with instructions on how to confirm your email address." expect(ActionMailer::Base.deliveries.count).to eq(0) end @@ -680,7 +680,7 @@ describe "Users" do fill_in "user_email", with: "manuela@consul.dev" click_button "Re-send instructions" - expect(page).to have_content "If your email address exists in our database, in a few minutes you will "\ + expect(page).to have_content "If your email address exists in our database, in a few minutes you will " \ "receive an email with instructions on how to confirm your email address." expect(ActionMailer::Base.deliveries.count).to eq(1) expect(ActionMailer::Base.deliveries.first.to).to eq(["manuela@consul.dev"]) diff --git a/spec/system/verification/letter_spec.rb b/spec/system/verification/letter_spec.rb index af64e8f49..f75a64669 100644 --- a/spec/system/verification/letter_spec.rb +++ b/spec/system/verification/letter_spec.rb @@ -10,7 +10,7 @@ describe "Verify Letter" do click_link "Send me a letter with the code" - expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes). In a few days"\ + expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes). In a few days" \ " we will send it to the address featuring in the data we have on file." user.reload diff --git a/spec/system/verification/level_three_verification_spec.rb b/spec/system/verification/level_three_verification_spec.rb index 20ca88ac8..0d2a30749 100644 --- a/spec/system/verification/level_three_verification_spec.rb +++ b/spec/system/verification/level_three_verification_spec.rb @@ -87,7 +87,7 @@ describe "Level three verification" do click_link "Send me a letter with the code" - expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes)."\ + expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes)." \ " In a few days we will send it to the address featuring in the data we have on file." end end From cbda85c48db3faaef15a24a446a8afd7e46b0c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 18 Jul 2023 03:36:22 +0200 Subject: [PATCH 12/13] Add and apply Style/LineEndConcatenation rule We were already using it in most places. Note that enabling this rule means we've got to change a few lines in order to follow the LineEndStringConcatenationIndentation rule. In the link list tests, the easiest way to do so was to use heredoc instead, which IMHO improves readability over the previous version. --- .rubocop.yml | 3 +++ .../shared/link_list_component_spec.rb | 18 ++++++++++++------ spec/system/admin/budget_investments_spec.rb | 12 ++++++------ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 380ba4ace..a7c32aafe 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -573,6 +573,9 @@ Style/IdenticalConditionalBranches: Style/IfWithBooleanLiteralBranches: Enabled: true +Style/LineEndConcatenation: + Enabled: true + Style/MapToHash: Enabled: true diff --git a/spec/components/shared/link_list_component_spec.rb b/spec/components/shared/link_list_component_spec.rb index f6ae9a3d4..962f07c30 100644 --- a/spec/components/shared/link_list_component_spec.rb +++ b/spec/components/shared/link_list_component_spec.rb @@ -18,9 +18,12 @@ describe Shared::LinkListComponent do ["Home", "/"], ["Info", "/info"], class: "menu" ) - expect(page).to be_rendered with: '\n" + expect(page).to be_rendered with: <<~HTML + + HTML end it "accepts anchor tags" do @@ -28,9 +31,12 @@ describe Shared::LinkListComponent do 'Home'.html_safe, ["Info", "/info"], class: "menu" ) - expect(page).to be_rendered with: '\n" + expect(page).to be_rendered with: <<~HTML + + HTML end it "accepts options for links" do diff --git a/spec/system/admin/budget_investments_spec.rb b/spec/system/admin/budget_investments_spec.rb index 43c0f16d0..ac7408eee 100644 --- a/spec/system/admin/budget_investments_spec.rb +++ b/spec/system/admin/budget_investments_spec.rb @@ -1797,8 +1797,8 @@ describe "Admin budget investments", :admin do columns_cookie = cookies.find { |cookie| cookie[:name] == "investments-columns" } cookie_value = columns_cookie[:value] - expect(cookie_value).to eq("id,title,supports,admin,valuator,geozone," + - "feasibility,price,valuation_finished,visible_to_valuators,selected,incompatible") + expect(cookie_value).to eq("id,title,supports,admin,valuator,geozone,feasibility,price," \ + "valuation_finished,visible_to_valuators,selected,incompatible") end scenario "Use column selector to display visible columns" do @@ -1847,8 +1847,8 @@ describe "Admin budget investments", :admin do columns_cookie = cookies.find { |cookie| cookie[:name] == "investments-columns" } cookie_value = columns_cookie[:value] - expect(cookie_value).to eq("id,supports,admin,geozone," + - "feasibility,valuation_finished,visible_to_valuators,selected,incompatible,author") + expect(cookie_value).to eq("id,supports,admin,geozone,feasibility,valuation_finished," \ + "visible_to_valuators,selected,incompatible,author") visit admin_budget_budget_investments_path(budget) @@ -1856,8 +1856,8 @@ describe "Admin budget investments", :admin do columns_cookie = cookies.find { |cookie| cookie[:name] == "investments-columns" } cookie_value = columns_cookie[:value] - expect(cookie_value).to eq("id,supports,admin,geozone,feasibility,valuation_finished," + - "visible_to_valuators,selected,incompatible,author") + expect(cookie_value).to eq("id,supports,admin,geozone,feasibility,valuation_finished," \ + "visible_to_valuators,selected,incompatible,author") end scenario "Select an investment when some columns are not displayed" do From c9676b8c3e4d3b9827c921fae89c816121804d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 18 Jul 2023 14:22:41 +0200 Subject: [PATCH 13/13] Enable alignment-related rubocop rules Even though we always follow these rules, this'll make it easier to run Rubocop with `--autocorrect` when we're applying multiline rules. --- .rubocop.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index a7c32aafe..1652ce3e3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -27,18 +27,32 @@ Layout/ArrayAlignment: Layout/AssignmentIndentation: Enabled: true +Layout/BeginEndAlignment: + Enabled: true + EnforcedStyleAlignWith: begin + Layout/BlockAlignment: Enabled: true +Layout/BlockEndNewline: + Enabled: true + Layout/ClosingHeredocIndentation: Enabled: true Layout/ClosingParenthesisIndentation: Enabled: true +Layout/DefEndAlignment: + Enabled: true + EnforcedStyleAlignWith: def + Layout/DotPosition: Enabled: true +Layout/ElseAlignment: + Enabled: true + Layout/EmptyLineAfterGuardClause: Enabled: true @@ -63,6 +77,9 @@ Layout/EmptyLinesAroundMethodBody: Layout/EmptyLinesAroundModuleBody: Enabled: true +Layout/EndAlignment: + Enabled: true + Layout/EndOfLine: EnforcedStyle: lf @@ -126,6 +143,12 @@ Layout/MultilineMethodCallIndentation: Layout/MultilineOperationIndentation: Enabled: true +Layout/ParameterAlignment: + Enabled: true + +Layout/RescueEnsureAlignment: + Enabled: true + Layout/SpaceAfterColon: Enabled: true
    <% unless @poll.expired? %> - <%= render Admin::TableActionsComponent.new(booth_assignment, + <%= render Admin::TableActionsComponent.new( + booth_assignment, actions: [:destroy], destroy_text: t("admin.booth_assignments.manage.actions.unassign"), destroy_confirmation: (booth_assignment.shifts? ? t("admin.poll_booth_assignments.alert.shifts") : ""), diff --git a/app/views/admin/poll/polls/_poll.html.erb b/app/views/admin/poll/polls/_poll.html.erb index 80b64d43c..9d692b867 100644 --- a/app/views/admin/poll/polls/_poll.html.erb +++ b/app/views/admin/poll/polls/_poll.html.erb @@ -7,7 +7,8 @@ <%= poll.sdg_target_list %> - <%= render Admin::TableActionsComponent.new(poll, + <%= render Admin::TableActionsComponent.new( + poll, destroy_confirmation: t("admin.polls.destroy.alert") ) do |actions| %> <%= actions.action(:configure) %> diff --git a/app/views/admin/poll/questions/answers/_form.html.erb b/app/views/admin/poll/questions/answers/_form.html.erb index ef32b93e5..7ecc89c8c 100644 --- a/app/views/admin/poll/questions/answers/_form.html.erb +++ b/app/views/admin/poll/questions/answers/_form.html.erb @@ -5,7 +5,7 @@ <%= render "shared/errors", resource: @answer %> <%= f.hidden_field :given_order, - value: @answer.persisted? ? @answer.given_order : @answer.class.last_position(@answer.question_id || @question.id) + 1 %> + value: @answer.persisted? ? @answer.given_order : @answer.class.last_position(@answer.question_id || @question.id) + 1 %>
    <%= f.translatable_fields do |translations_form| %> diff --git a/app/views/admin/poll/shifts/_form.html.erb b/app/views/admin/poll/shifts/_form.html.erb index c60458759..2c0fc6249 100644 --- a/app/views/admin/poll/shifts/_form.html.erb +++ b/app/views/admin/poll/shifts/_form.html.erb @@ -14,29 +14,29 @@
    <%= f.select :task, - Poll::Shift.tasks.map { |k, v| [t("admin.poll_shifts.#{k}"), k] }, - { prompt: t("admin.poll_shifts.new.select_task") }, - class: "js-poll-shifts" %> + Poll::Shift.tasks.map { |k, v| [t("admin.poll_shifts.#{k}"), k] }, + { prompt: t("admin.poll_shifts.new.select_task") }, + class: "js-poll-shifts" %>
    <%= select "shift[date]", "vote_collection_date", - options_for_select(shift_vote_collection_dates(@booth, @voting_polls)), - { prompt: @voting_polls.present? ? t("admin.poll_shifts.new.select_date") : t("admin.poll_shifts.new.no_voting_days") }, - class: "js-shift-vote-collection-dates" %> + options_for_select(shift_vote_collection_dates(@booth, @voting_polls)), + { prompt: @voting_polls.present? ? t("admin.poll_shifts.new.select_date") : t("admin.poll_shifts.new.no_voting_days") }, + class: "js-shift-vote-collection-dates" %> <%= select "shift[date]", "recount_scrutiny_date", - options_for_select(shift_recount_scrutiny_dates(@booth, @recount_polls)), - { prompt: t("admin.poll_shifts.new.select_date") }, - class: "js-shift-recount-scrutiny-dates", - hidden: "hidden" %> + options_for_select(shift_recount_scrutiny_dates(@booth, @recount_polls)), + { prompt: t("admin.poll_shifts.new.select_date") }, + class: "js-shift-recount-scrutiny-dates", + hidden: "hidden" %>
    <%= f.hidden_field :booth_id, value: @booth.id %>
    <%= f.submit t("admin.poll_shifts.new.add_shift"), - class: "button expanded margin-top" %> + class: "button expanded margin-top" %>
    <% end %> diff --git a/app/views/admin/poll/shifts/_search_officers.html.erb b/app/views/admin/poll/shifts/_search_officers.html.erb index e95090f9c..4a601c852 100644 --- a/app/views/admin/poll/shifts/_search_officers.html.erb +++ b/app/views/admin/poll/shifts/_search_officers.html.erb @@ -3,9 +3,9 @@ method: :get, remote: true do |f| %>
    <%= text_field_tag :search, - @search, - placeholder: t("admin.poll_shifts.new.search_officer_placeholder"), - id: "search-officers" %> + @search, + placeholder: t("admin.poll_shifts.new.search_officer_placeholder"), + id: "search-officers" %>
    <%= submit_tag t("admin.poll_shifts.new.search_officer_button"), class: "button" %> diff --git a/app/views/admin/poll/shifts/_shifts.html.erb b/app/views/admin/poll/shifts/_shifts.html.erb index d3cda31fb..c8d884b6d 100644 --- a/app/views/admin/poll/shifts/_shifts.html.erb +++ b/app/views/admin/poll/shifts/_shifts.html.erb @@ -17,7 +17,8 @@
    <%= shift.officer_email %> <%= t("admin.poll_shifts.#{shift.task}") %> - <%= render Admin::TableActionsComponent.new(shift, + <%= render Admin::TableActionsComponent.new( + shift, actions: [:destroy], destroy_text: t("admin.poll_shifts.new.remove_shift") ) %> diff --git a/app/views/admin/settings/_content_types_settings_form.html.erb b/app/views/admin/settings/_content_types_settings_form.html.erb index 4c3cb347b..458f9d8e8 100644 --- a/app/views/admin/settings/_content_types_settings_form.html.erb +++ b/app/views/admin/settings/_content_types_settings_form.html.erb @@ -6,8 +6,8 @@ <% Setting.mime_types[group].each do |content_type, mime_type_value| %> <%= check_box_tag content_type, - setting.value.split.include?(mime_type_value), - setting.value.split.include?(mime_type_value) %> + setting.value.split.include?(mime_type_value), + setting.value.split.include?(mime_type_value) %> <%= label_tag content_type, content_type.upcase %> <% end %> diff --git a/app/views/admin/settings/_map_form.html.erb b/app/views/admin/settings/_map_form.html.erb index 8c85666f7..c71b412a0 100644 --- a/app/views/admin/settings/_map_form.html.erb +++ b/app/views/admin/settings/_map_form.html.erb @@ -23,7 +23,7 @@
    <%= submit_tag t("admin.settings.index.map.form.submit"), - class: "button hollow expanded" %> + class: "button hollow expanded" %>
    <% end %> diff --git a/app/views/admin/settings/_settings_form.html.erb b/app/views/admin/settings/_settings_form.html.erb index 33e9ab8f1..464713004 100644 --- a/app/views/admin/settings/_settings_form.html.erb +++ b/app/views/admin/settings/_settings_form.html.erb @@ -2,10 +2,10 @@ <%= f.hidden_field :tab, id: dom_id(setting, :tab), value: tab if defined?(tab) %>
    <%= f.text_area :value, - label: false, - id: dom_id(setting, :value), - "aria-label": strip_tags(t("settings.#{setting.key}")), - "aria-describedby": dom_id(setting, :description) %> + label: false, + id: dom_id(setting, :value), + "aria-label": strip_tags(t("settings.#{setting.key}")), + "aria-describedby": dom_id(setting, :description) %>
    <%= f.submit(t("admin.settings.index.update_setting"), class: "button hollow expanded") %> diff --git a/app/views/admin/shared/_budget_investment_search.html.erb b/app/views/admin/shared/_budget_investment_search.html.erb index 86f77dfc5..7e9d3d082 100644 --- a/app/views/admin/shared/_budget_investment_search.html.erb +++ b/app/views/admin/shared/_budget_investment_search.html.erb @@ -5,9 +5,9 @@
    <%= select_tag :heading_id, - options_for_select(budget_heading_select_options(@budget), - params[:heading_id]), - include_blank: true %> + options_for_select(budget_heading_select_options(@budget), + params[:heading_id]), + include_blank: true %>
    diff --git a/app/views/admin/signature_sheets/new.html.erb b/app/views/admin/signature_sheets/new.html.erb index 5dd736d17..70ab8ab49 100644 --- a/app/views/admin/signature_sheets/new.html.erb +++ b/app/views/admin/signature_sheets/new.html.erb @@ -4,7 +4,7 @@ <%= form_for [:admin, @signature_sheet] do |f| %> <%= render "shared/errors", - resource: @signature_sheet %> + resource: @signature_sheet %>
    <%= f.text_field :title %> diff --git a/app/views/admin/signature_sheets/show.html.erb b/app/views/admin/signature_sheets/show.html.erb index 1b235ae2c..b4446c77e 100644 --- a/app/views/admin/signature_sheets/show.html.erb +++ b/app/views/admin/signature_sheets/show.html.erb @@ -21,12 +21,12 @@
    <%= t("admin.signature_sheets.show.verified", - count: @signature_sheet.signatures.verified.count) %> + count: @signature_sheet.signatures.verified.count) %>
    <%= t("admin.signature_sheets.show.voted", - count: @voted_signatures) %> + count: @voted_signatures) %>
    @@ -35,7 +35,7 @@

    <%= t("admin.signature_sheets.show.unverified", - count: @signature_sheet.signatures.unverified.count) %> + count: @signature_sheet.signatures.unverified.count) %> <%= t("admin.signature_sheets.show.unverified_error") %>

    diff --git a/app/views/admin/site_customization/information_texts/_globalize_locales.html.erb b/app/views/admin/site_customization/information_texts/_globalize_locales.html.erb index ef93a7ae7..da4297ad1 100644 --- a/app/views/admin/site_customization/information_texts/_globalize_locales.html.erb +++ b/app/views/admin/site_customization/information_texts/_globalize_locales.html.erb @@ -1,4 +1,4 @@ <%= render "shared/common_globalize_locales", - resource: nil, - display_style: lambda { |locale| site_customization_display_translation_style(locale) }, - manage_languages: defined?(manage_languages) ? manage_languages : true %> + resource: nil, + display_style: lambda { |locale| site_customization_display_translation_style(locale) }, + manage_languages: defined?(manage_languages) ? manage_languages : true %> diff --git a/app/views/admin/stats/show.html.erb b/app/views/admin/stats/show.html.erb index 8a633637c..f5fa82d3c 100644 --- a/app/views/admin/stats/show.html.erb +++ b/app/views/admin/stats/show.html.erb @@ -13,9 +13,9 @@ <%= link_to t("admin.stats.show.proposal_notifications"), proposal_notifications_admin_stats_path, class: "button hollow" %> <%= link_to t("admin.stats.show.incomplete_verifications"), - admin_verifications_path, class: "button hollow" %> + admin_verifications_path, class: "button hollow" %> <%= link_to t("admin.stats.show.sdg"), - sdg_admin_stats_path, class: "button hollow" if feature?(:sdg) %> + sdg_admin_stats_path, class: "button hollow" if feature?(:sdg) %>
    diff --git a/app/views/admin/system_emails/preview_pending/_proposal_notification_digest.html.erb b/app/views/admin/system_emails/preview_pending/_proposal_notification_digest.html.erb index 2d86e0812..fa02ac0a5 100644 --- a/app/views/admin/system_emails/preview_pending/_proposal_notification_digest.html.erb +++ b/app/views/admin/system_emails/preview_pending/_proposal_notification_digest.html.erb @@ -31,10 +31,10 @@
    <%= link_to t("admin.system_emails.preview_pending.moderate_pending"), - admin_system_email_moderate_pending_path(system_email_id: "proposal_notification_digest", - id: preview.id), - method: :put, - class: "button hollow float-right" %> + admin_system_email_moderate_pending_path(system_email_id: "proposal_notification_digest", + id: preview.id), + method: :put, + class: "button hollow float-right" %>
    <% end %> diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index 39583f933..8c0262f08 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -22,11 +22,11 @@
    <%= form_for(tag, - url: admin_tag_path(tag), - as: :tag, - html: { id: "edit_tag_#{tag.id}" }) do |f| %> + url: admin_tag_path(tag), + as: :tag, + html: { id: "edit_tag_#{tag.id}" }) do |f| %> - <%= tag.name %> + <%= tag.name %> <% end %> diff --git a/app/views/budgets/executions/show.html.erb b/app/views/budgets/executions/show.html.erb index acb4f3822..dcbfe24f6 100644 --- a/app/views/budgets/executions/show.html.erb +++ b/app/views/budgets/executions/show.html.erb @@ -2,9 +2,9 @@ <% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %> <% provide :social_media_meta_tags do %> <%= render "shared/social_media_meta_tags", - social_url: budget_executions_url(@budget), - social_title: @budget.name, - social_description: @budget.description_for_phase("finished") %> + social_url: budget_executions_url(@budget), + social_title: @budget.name, + social_description: @budget.description_for_phase("finished") %> <% end %> <% content_for :canonical do %> diff --git a/app/views/budgets/investments/_header.html.erb b/app/views/budgets/investments/_header.html.erb index 5f1ab18b8..cd30b56b1 100644 --- a/app/views/budgets/investments/_header.html.erb +++ b/app/views/budgets/investments/_header.html.erb @@ -37,12 +37,12 @@
    <%= sanitize(t("budgets.investments.header.different_heading_assigned", - heading_link: heading_link(@assigned_heading, @budget))) %> + heading_link: heading_link(@assigned_heading, @budget))) %>
    <%= sanitize(t("budgets.investments.header.change_ballot", - check_ballot: link_to(t("budgets.investments.header.check_ballot_link"), - budget_ballot_path(@budget)))) %> + check_ballot: link_to(t("budgets.investments.header.check_ballot_link"), + budget_ballot_path(@budget)))) %>
    diff --git a/app/views/budgets/investments/_investment.html.erb b/app/views/budgets/investments/_investment.html.erb index 1a4009952..2f67a5a9a 100644 --- a/app/views/budgets/investments/_investment.html.erb +++ b/app/views/budgets/investments/_investment.html.erb @@ -42,7 +42,7 @@
    <%= t("budgets.investments.investment.supports", - count: investment.total_votes) %> + count: investment.total_votes) %>
    @@ -50,9 +50,9 @@
    <%= render "/budgets/investments/ballot", - investment: investment, - investment_ids: investment_ids, - ballot: ballot %> + investment: investment, + investment_ids: investment_ids, + ballot: ballot %>
    <% elsif investment.should_show_price? %>
    <%= render "documents/documents", - documents: investment.documents, - max_documents_allowed: Budget::Investment.max_documents_allowed %> + documents: investment.documents, + max_documents_allowed: Budget::Investment.max_documents_allowed %> <% end %> <%= render "shared/tags", taggable: investment %> diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index aec6ec3b5..10e1fd18c 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -1,10 +1,10 @@ <% provide :social_media_meta_tags do %> <%= render "shared/social_media_meta_tags", - social_url: budget_investments_path(investment), - social_title: investment.title, - social_description: investment.description, - twitter_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil), - og_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil) %> + social_url: budget_investments_path(investment), + social_title: investment.title, + social_description: investment.description, + twitter_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil), + og_image_url: (investment.image.present? ? polymorphic_path(investment.image.variant(:thumb)) : nil) %> <% end %>
    @@ -39,7 +39,7 @@ <%= t("budgets.investments.investment.supports", - count: investment.total_votes) %> + count: investment.total_votes) %>
    @@ -49,9 +49,9 @@
    <%= render "ballot", - investment: investment, - investment_ids: investment_ids, - ballot: ballot %> + investment: investment, + investment_ids: investment_ids, + ballot: ballot %>
    <% end %> @@ -93,22 +93,23 @@ <% if investment.should_show_price_explanation? %>
    <%= link_to t("budgets.investments.show.see_price_explanation"), - "#price_explanation", class: "small" %> + "#price_explanation", + class: "small" %>
    <% end %> <% end %> <%= render "shared/social_share", - share_title: t("budgets.investments.show.share"), - title: investment.title, - image_url: image_absolute_url(investment.image, :thumb), - url: budget_investment_url(investment.budget, investment), - description: t("budgets.investments.share.message", - title: investment.title, - handle: setting["org_name"]), - mobile: t("budgets.investments.share.message", - title: investment.title, - handle: setting["twitter_handle"]) %> + share_title: t("budgets.investments.show.share"), + title: investment.title, + image_url: image_absolute_url(investment.image, :thumb), + url: budget_investment_url(investment.budget, investment), + description: t("budgets.investments.share.message", + title: investment.title, + handle: setting["org_name"]), + mobile: t("budgets.investments.share.message", + title: investment.title, + handle: setting["twitter_handle"]) %> <% if current_user %> diff --git a/app/views/budgets/investments/_sidebar.html.erb b/app/views/budgets/investments/_sidebar.html.erb index 9aba3eeb1..a822c2efd 100644 --- a/app/views/budgets/investments/_sidebar.html.erb +++ b/app/views/budgets/investments/_sidebar.html.erb @@ -3,11 +3,12 @@ <% if can?(:create, Budget::Investment.new(budget: @budget)) %> <% if current_user && current_user.level_two_or_three_verified? %> <%= link_to t("budgets.investments.index.sidebar.create"), - new_budget_investment_path(budget_id: @budget.id), class: "button budget expanded" %> + new_budget_investment_path(budget_id: @budget.id), + class: "button budget expanded" %> <% else %>
    <%= sanitize(t("budgets.investments.index.sidebar.verified_only", - verify: link_to_verify_account)) %> + verify: link_to_verify_account)) %>
    <% end %> <% end %> diff --git a/app/views/budgets/investments/index.html.erb b/app/views/budgets/investments/index.html.erb index 99e47d0c9..08a481d6d 100644 --- a/app/views/budgets/investments/index.html.erb +++ b/app/views/budgets/investments/index.html.erb @@ -7,9 +7,9 @@ <% content_for :canonical do %> <% if @heading.present? %> <%= render "shared/canonical", - href: budget_investments_url(@budget, - heading_id: @heading.id, - filter: @current_filter) %> + href: budget_investments_url(@budget, + heading_id: @heading.id, + filter: @current_filter) %> <% else %> <%= render "shared/canonical", href: budget_investments_url(@budget) %> <% end %> diff --git a/app/views/budgets/investments/show.html.erb b/app/views/budgets/investments/show.html.erb index 042e70d46..d3e4cdb8d 100644 --- a/app/views/budgets/investments/show.html.erb +++ b/app/views/budgets/investments/show.html.erb @@ -4,9 +4,9 @@ <% end %> <%= render "/budgets/investments/investment_show", - investment: @investment, - investment_ids: @investment_ids, - ballot: @ballot %> + investment: @investment, + investment_ids: @investment_ids, + ballot: @ballot %>
    diff --git a/app/views/budgets/results/show.html.erb b/app/views/budgets/results/show.html.erb index 605309c1b..aedae4faf 100644 --- a/app/views/budgets/results/show.html.erb +++ b/app/views/budgets/results/show.html.erb @@ -2,9 +2,9 @@ <% content_for :meta_description do %><%= @budget.description_for_phase("finished") %><% end %> <% provide :social_media_meta_tags do %> <%= render "shared/social_media_meta_tags", - social_url: budget_results_url(@budget), - social_title: @budget.name, - social_description: @budget.description_for_phase("finished") %> + social_url: budget_results_url(@budget), + social_title: @budget.name, + social_description: @budget.description_for_phase("finished") %> <% end %> <% content_for :canonical do %> <%= render "shared/canonical", href: budget_results_url(@budget) %> diff --git a/app/views/budgets/stats/show.html.erb b/app/views/budgets/stats/show.html.erb index 5ad9e09ba..be60f24c4 100644 --- a/app/views/budgets/stats/show.html.erb +++ b/app/views/budgets/stats/show.html.erb @@ -3,9 +3,9 @@ <% end %> <% provide :social_media_meta_tags do %> <%= render "shared/social_media_meta_tags", - social_url: budget_stats_url(@budget), - social_title: @budget.name, - social_description: @budget.description_for_phase("finished") %> + social_url: budget_stats_url(@budget), + social_title: @budget.name, + social_description: @budget.description_for_phase("finished") %> <% end %>
    diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index 41b5e61eb..17813cace 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -4,9 +4,9 @@
    <%= form_for Comment.new, remote: true, html: { id: "new_comment_#{css_id}" } do |f| %> <%= f.text_area :body, - id: "comment-body-#{css_id}", - maxlength: Comment.body_max_length, - label: leave_comment_text(commentable) %> + id: "comment-body-#{css_id}", + maxlength: Comment.body_max_length, + label: leave_comment_text(commentable) %> <%= f.hidden_field :commentable_type, value: commentable.class.name, id: "comment_commentable_type_#{css_id}" %> <%= f.hidden_field :commentable_id, value: commentable.id, id: "comment_commentable_id_#{css_id}" %> @@ -18,15 +18,15 @@ <% if can? :comment_as_moderator, commentable %>
    <%= f.check_box :as_moderator, - label: t("comments.form.comment_as_moderator"), - id: "comment-as-moderator-#{css_id}" %> + label: t("comments.form.comment_as_moderator"), + id: "comment-as-moderator-#{css_id}" %>
    <% end %> <% if can? :comment_as_administrator, commentable %>
    <%= f.check_box :as_administrator, - label: t("comments.form.comment_as_admin"), - id: "comment-as-administrator-#{css_id}" %> + label: t("comments.form.comment_as_admin"), + id: "comment-as-administrator-#{css_id}" %>
    <% end %> diff --git a/app/views/communities/_poll.html.erb b/app/views/communities/_poll.html.erb index 22825a981..52bfe6764 100644 --- a/app/views/communities/_poll.html.erb +++ b/app/views/communities/_poll.html.erb @@ -5,6 +5,7 @@

    <%= t("communities.poll.take_part", - from: l(poll.starts_at.to_date), to: l(poll.ends_at.to_date)) %> + from: l(poll.starts_at.to_date), + to: l(poll.ends_at.to_date)) %>

    diff --git a/app/views/dashboard/_goal.html.erb b/app/views/dashboard/_goal.html.erb index b100e1952..2c51072aa 100644 --- a/app/views/dashboard/_goal.html.erb +++ b/app/views/dashboard/_goal.html.erb @@ -2,8 +2,8 @@
    <%= t("dashboard.goal.target_supports", - count: number_with_precision(goal.required_supports, - delimiter: ".", precision: 0)) %> + count: number_with_precision(goal.required_supports, + delimiter: ".", precision: 0)) %>
    diff --git a/app/views/dashboard/_mailing_resource.html.erb b/app/views/dashboard/_mailing_resource.html.erb index ed85a5642..2ec0beb40 100644 --- a/app/views/dashboard/_mailing_resource.html.erb +++ b/app/views/dashboard/_mailing_resource.html.erb @@ -8,8 +8,8 @@
    <%= link_to t("dashboard.resource.view_resource"), - new_proposal_dashboard_mailing_path(proposal.to_param), - class: "button expanded" %> + new_proposal_dashboard_mailing_path(proposal.to_param), + class: "button expanded" %>
    diff --git a/app/views/dashboard/_poll_resource.html.erb b/app/views/dashboard/_poll_resource.html.erb index 5a02a4466..39d21ea8e 100644 --- a/app/views/dashboard/_poll_resource.html.erb +++ b/app/views/dashboard/_poll_resource.html.erb @@ -8,8 +8,8 @@
    <%= link_to t("dashboard.resource.view_resource"), - proposal_dashboard_polls_path(proposal.to_param), - class: "button expanded" %> + proposal_dashboard_polls_path(proposal.to_param), + class: "button expanded" %>
    diff --git a/app/views/dashboard/_poster_resource.html.erb b/app/views/dashboard/_poster_resource.html.erb index 85f2c27bf..0f47d6c32 100644 --- a/app/views/dashboard/_poster_resource.html.erb +++ b/app/views/dashboard/_poster_resource.html.erb @@ -8,8 +8,8 @@
    <%= link_to t("dashboard.resource.view_resource"), - new_proposal_dashboard_poster_path(proposal.to_param), - class: "button expanded" %> + new_proposal_dashboard_poster_path(proposal.to_param), + class: "button expanded" %>
    diff --git a/app/views/dashboard/community.html.erb b/app/views/dashboard/community.html.erb index b23137339..cdf57a365 100644 --- a/app/views/dashboard/community.html.erb +++ b/app/views/dashboard/community.html.erb @@ -9,7 +9,7 @@ <% if proposal.community.latest_activity.present? %>

    <%= t("dashboard.community.latest_activity", - at: l(proposal.community.latest_activity.to_date)) %> + at: l(proposal.community.latest_activity.to_date)) %>

    <% end %> diff --git a/app/views/dashboard/mailer/new_actions_notification_on_published.html.erb b/app/views/dashboard/mailer/new_actions_notification_on_published.html.erb index 46d39c5ba..287899d12 100644 --- a/app/views/dashboard/mailer/new_actions_notification_on_published.html.erb +++ b/app/views/dashboard/mailer/new_actions_notification_on_published.html.erb @@ -3,8 +3,8 @@

    <%= t("mailers.new_actions_notification_on_published.hi", - name: @proposal.author.name, - title: @proposal.title) %> + name: @proposal.author.name, + title: @proposal.title) %>

    <%= t("mailers.new_actions_notification_on_published.text_1") %> @@ -49,11 +49,11 @@

    <%= link_to progress_proposal_dashboard_url(@proposal), - style: "font-family: 'Open Sans',arial,sans-serif; background: #3700fd; - border-radius: 6px; color: #fff !important; font-weight: bold; - padding: 17px 20px; text-align: center; text-decoration: none; - font-size: 20px; min-width: 200px; display: inline-block;", - target: "_blank" do %> + style: "font-family: 'Open Sans',arial,sans-serif; background: #3700fd;" \ + "border-radius: 6px; color: #fff !important; font-weight: bold;" \ + "padding: 17px 20px; text-align: center; text-decoration: none;" \ + "font-size: 20px; min-width: 200px; display: inline-block;", + target: "_blank" do %> <%= t("mailers.new_actions_notification_on_published.dashboard_button") %> <% end %> <%= link_to user_url(@direct_message.sender), style: css_for_mailer_button, target: "_blank" do %> <%= t("mailers.direct_message_for_receiver.reply", - sender: @direct_message.sender.name) %> + sender: @direct_message.sender.name) %> <% end %>

    - <%= t("mailers.user_invite.title", - org: Setting["org_name"]) %> + <%= t("mailers.user_invite.title", org: Setting["org_name"]) %>

    - <%= t("mailers.user_invite.text", - org: Setting["org_name"]) %> + <%= t("mailers.user_invite.text", org: Setting["org_name"]) %>

    diff --git a/app/views/management/_account_info.html.erb b/app/views/management/_account_info.html.erb index cb262a9ef..ab37d813b 100644 --- a/app/views/management/_account_info.html.erb +++ b/app/views/management/_account_info.html.erb @@ -1,9 +1,9 @@ <% if managed_user.document_number.present? %>

    <%= link_to t("officing.poll_budgets.index.ballot_sheet", id: ballot_sheet.id), - officing_poll_ballot_sheet_path(@poll.id, ballot_sheet.id) %> <%= ballot_sheet.author %> <%= l(ballot_sheet.created_at, format: :long) %>