diff --git a/.rubocop.yml b/.rubocop.yml index b1c79a16c..cf9fb516e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -353,6 +353,3 @@ Security/MarshalLoad: Security/YAMLLoad: Enabled: true - -Style/PercentLiteralDelimiters: - Enabled: true diff --git a/.rubocop_basic.yml b/.rubocop_basic.yml index 44beb5256..8529369be 100644 --- a/.rubocop_basic.yml +++ b/.rubocop_basic.yml @@ -68,5 +68,8 @@ Rails/TimeZone: RSpec/NotToNot: Enabled: true +Style/PercentLiteralDelimiters: + Enabled: true + Style/StringLiterals: EnforcedStyle: double_quotes diff --git a/app/controllers/admin/activity_controller.rb b/app/controllers/admin/activity_controller.rb index ce9c04183..44357c5fb 100644 --- a/app/controllers/admin/activity_controller.rb +++ b/app/controllers/admin/activity_controller.rb @@ -1,5 +1,5 @@ class Admin::ActivityController < Admin::BaseController - has_filters %w{all on_users on_proposals on_debates on_comments on_system_emails} + has_filters %w[all on_users on_proposals on_debates on_comments on_system_emails] def show @activity = Activity.for_render.send(@current_filter) diff --git a/app/controllers/admin/banners_controller.rb b/app/controllers/admin/banners_controller.rb index 1a486bb56..fed5fe8c8 100644 --- a/app/controllers/admin/banners_controller.rb +++ b/app/controllers/admin/banners_controller.rb @@ -1,7 +1,7 @@ class Admin::BannersController < Admin::BaseController include Translatable - has_filters %w{all with_active with_inactive}, only: :index + has_filters %w[all with_active with_inactive], only: :index before_action :banner_sections, only: [:edit, :new, :create, :update] diff --git a/app/controllers/admin/budgets_controller.rb b/app/controllers/admin/budgets_controller.rb index fdfaaf017..aac0f979e 100644 --- a/app/controllers/admin/budgets_controller.rb +++ b/app/controllers/admin/budgets_controller.rb @@ -4,7 +4,7 @@ class Admin::BudgetsController < Admin::BaseController include FeatureFlags feature_flag :budgets - has_filters %w{open finished}, only: :index + has_filters %w[open finished], only: :index before_action :load_budget, except: [:index, :new, :create] load_and_authorize_resource diff --git a/app/controllers/admin/hidden_budget_investments_controller.rb b/app/controllers/admin/hidden_budget_investments_controller.rb index f34818361..08b95dffc 100644 --- a/app/controllers/admin/hidden_budget_investments_controller.rb +++ b/app/controllers/admin/hidden_budget_investments_controller.rb @@ -1,7 +1,7 @@ class Admin::HiddenBudgetInvestmentsController < Admin::BaseController include FeatureFlags - has_filters %w{all with_confirmed_hide without_confirmed_hide}, only: :index + has_filters %w[all with_confirmed_hide without_confirmed_hide], only: :index feature_flag :budgets diff --git a/app/controllers/admin/hidden_comments_controller.rb b/app/controllers/admin/hidden_comments_controller.rb index 561fe3aef..e17926b36 100644 --- a/app/controllers/admin/hidden_comments_controller.rb +++ b/app/controllers/admin/hidden_comments_controller.rb @@ -1,5 +1,5 @@ class Admin::HiddenCommentsController < Admin::BaseController - has_filters %w{without_confirmed_hide all with_confirmed_hide} + has_filters %w[without_confirmed_hide all with_confirmed_hide] before_action :load_comment, only: [:confirm_hide, :restore] diff --git a/app/controllers/admin/hidden_debates_controller.rb b/app/controllers/admin/hidden_debates_controller.rb index 3e93db0a6..84374f63c 100644 --- a/app/controllers/admin/hidden_debates_controller.rb +++ b/app/controllers/admin/hidden_debates_controller.rb @@ -3,7 +3,7 @@ class Admin::HiddenDebatesController < Admin::BaseController feature_flag :debates - has_filters %w{without_confirmed_hide all with_confirmed_hide}, only: :index + has_filters %w[without_confirmed_hide all with_confirmed_hide], only: :index before_action :load_debate, only: [:confirm_hide, :restore] diff --git a/app/controllers/admin/hidden_users_controller.rb b/app/controllers/admin/hidden_users_controller.rb index 8237b7fd4..6035d5804 100644 --- a/app/controllers/admin/hidden_users_controller.rb +++ b/app/controllers/admin/hidden_users_controller.rb @@ -1,5 +1,5 @@ class Admin::HiddenUsersController < Admin::BaseController - has_filters %w{without_confirmed_hide all with_confirmed_hide}, only: :index + has_filters %w[without_confirmed_hide all with_confirmed_hide], only: :index before_action :load_user, only: [:confirm_hide, :restore] diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index 9c26147e2..117d7037a 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -1,5 +1,5 @@ class Admin::OrganizationsController < Admin::BaseController - has_filters %w{pending all verified rejected}, only: :index + has_filters %w[pending all verified rejected], only: :index load_and_authorize_resource except: :search diff --git a/app/controllers/admin/proposal_notifications_controller.rb b/app/controllers/admin/proposal_notifications_controller.rb index 1fee9a055..f83cb1580 100644 --- a/app/controllers/admin/proposal_notifications_controller.rb +++ b/app/controllers/admin/proposal_notifications_controller.rb @@ -1,6 +1,6 @@ class Admin::ProposalNotificationsController < Admin::BaseController - has_filters %w{without_confirmed_hide all with_confirmed_hide}, only: :index + has_filters %w[without_confirmed_hide all with_confirmed_hide], only: :index before_action :load_proposal, only: [:confirm_hide, :restore] diff --git a/app/controllers/budgets/investments_controller.rb b/app/controllers/budgets/investments_controller.rb index 5a57dd1f4..18127079b 100644 --- a/app/controllers/budgets/investments_controller.rb +++ b/app/controllers/budgets/investments_controller.rb @@ -30,7 +30,7 @@ module Budgets feature_flag :budgets - has_orders %w{most_voted newest oldest}, only: :show + has_orders %w[most_voted newest oldest], only: :show has_orders ->(c) { c.instance_variable_get(:@budget).investments_orders }, only: :index valid_filters = %w[not_unfeasible feasible unfeasible unselected selected winners] diff --git a/app/controllers/communities_controller.rb b/app/controllers/communities_controller.rb index fc8298d41..040272fc5 100644 --- a/app/controllers/communities_controller.rb +++ b/app/controllers/communities_controller.rb @@ -1,5 +1,5 @@ class CommunitiesController < ApplicationController - TOPIC_ORDERS = %w{newest most_commented oldest}.freeze + TOPIC_ORDERS = %w[newest most_commented oldest].freeze before_action :set_order, :set_community, :load_topics, :load_participants has_orders TOPIC_ORDERS diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index c0def9803..b83f2ddc2 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -14,7 +14,7 @@ class DebatesController < ApplicationController invisible_captcha only: [:create, :update], honeypot: :subtitle has_orders ->(c) { Debate.debates_orders(c.current_user) }, only: :index - has_orders %w{most_voted newest oldest}, only: :show + has_orders %w[most_voted newest oldest], only: :show load_and_authorize_resource helper_method :resource_model, :resource_name diff --git a/app/controllers/legislation/proposals_controller.rb b/app/controllers/legislation/proposals_controller.rb index 944a4f6aa..4db3b0e72 100644 --- a/app/controllers/legislation/proposals_controller.rb +++ b/app/controllers/legislation/proposals_controller.rb @@ -13,8 +13,8 @@ class Legislation::ProposalsController < Legislation::BaseController invisible_captcha only: [:create, :update], honeypot: :subtitle - has_orders %w{confidence_score created_at}, only: :index - has_orders %w{most_voted newest oldest}, only: :show + has_orders %w[confidence_score created_at], only: :index + has_orders %w[most_voted newest oldest], only: :show helper_method :resource_model, :resource_name respond_to :html, :js diff --git a/app/controllers/legislation/questions_controller.rb b/app/controllers/legislation/questions_controller.rb index d50443281..7ee66fd64 100644 --- a/app/controllers/legislation/questions_controller.rb +++ b/app/controllers/legislation/questions_controller.rb @@ -2,7 +2,7 @@ class Legislation::QuestionsController < Legislation::BaseController load_and_authorize_resource :process load_and_authorize_resource :question, through: :process - has_orders %w{most_voted newest oldest}, only: :show + has_orders %w[most_voted newest oldest], only: :show def show @commentable = @question diff --git a/app/controllers/moderation/budgets/investments_controller.rb b/app/controllers/moderation/budgets/investments_controller.rb index a56534259..8944c78fa 100644 --- a/app/controllers/moderation/budgets/investments_controller.rb +++ b/app/controllers/moderation/budgets/investments_controller.rb @@ -2,8 +2,8 @@ class Moderation::Budgets::InvestmentsController < Moderation::BaseController include FeatureFlags include ModerateActions - has_filters %w{pending_flag_review all with_ignored_flag}, only: :index - has_orders %w{flags created_at}, only: :index + has_filters %w[pending_flag_review all with_ignored_flag], only: :index + has_orders %w[flags created_at], only: :index feature_flag :budgets diff --git a/app/controllers/moderation/comments_controller.rb b/app/controllers/moderation/comments_controller.rb index d5fbf7954..6a93108ba 100644 --- a/app/controllers/moderation/comments_controller.rb +++ b/app/controllers/moderation/comments_controller.rb @@ -1,8 +1,8 @@ class Moderation::CommentsController < Moderation::BaseController include ModerateActions - has_filters %w{pending_flag_review all with_ignored_flag}, only: :index - has_orders %w{flags newest}, only: :index + has_filters %w[pending_flag_review all with_ignored_flag], only: :index + has_orders %w[flags newest], only: :index before_action :load_resources, only: [:index, :moderate] diff --git a/app/controllers/moderation/debates_controller.rb b/app/controllers/moderation/debates_controller.rb index aaa3d9f89..a85d300d2 100644 --- a/app/controllers/moderation/debates_controller.rb +++ b/app/controllers/moderation/debates_controller.rb @@ -2,8 +2,8 @@ class Moderation::DebatesController < Moderation::BaseController include ModerateActions include FeatureFlags - has_filters %w{pending_flag_review all with_ignored_flag}, only: :index - has_orders %w{flags created_at}, only: :index + has_filters %w[pending_flag_review all with_ignored_flag], only: :index + has_orders %w[flags created_at], only: :index feature_flag :debates diff --git a/app/controllers/moderation/proposal_notifications_controller.rb b/app/controllers/moderation/proposal_notifications_controller.rb index d36e0614e..abd680d5f 100644 --- a/app/controllers/moderation/proposal_notifications_controller.rb +++ b/app/controllers/moderation/proposal_notifications_controller.rb @@ -1,8 +1,8 @@ class Moderation::ProposalNotificationsController < Moderation::BaseController include ModerateActions - has_filters %w{pending_review all ignored}, only: :index - has_orders %w{created_at moderated}, only: :index + has_filters %w[pending_review all ignored], only: :index + has_orders %w[created_at moderated], only: :index before_action :load_resources, only: [:index, :moderate] diff --git a/app/controllers/moderation/proposals_controller.rb b/app/controllers/moderation/proposals_controller.rb index f15aca85d..6d358c1bf 100644 --- a/app/controllers/moderation/proposals_controller.rb +++ b/app/controllers/moderation/proposals_controller.rb @@ -2,8 +2,8 @@ class Moderation::ProposalsController < Moderation::BaseController include ModerateActions include FeatureFlags - has_filters %w{pending_flag_review all with_ignored_flag}, only: :index - has_orders %w{flags created_at}, only: :index + has_filters %w[pending_flag_review all with_ignored_flag], only: :index + has_orders %w[flags created_at], only: :index feature_flag :proposals diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rb index f3f0dd7ef..1c7b4732e 100644 --- a/app/controllers/topics_controller.rb +++ b/app/controllers/topics_controller.rb @@ -4,7 +4,7 @@ class TopicsController < ApplicationController before_action :load_community before_action :load_topic, only: [:show, :edit, :update, :destroy] - has_orders %w{most_voted newest oldest}, only: :show + has_orders %w[most_voted newest oldest], only: :show skip_authorization_check only: :show load_and_authorize_resource except: :show diff --git a/app/controllers/tracking/budget_investments_controller.rb b/app/controllers/tracking/budget_investments_controller.rb index 65afda323..946f61143 100644 --- a/app/controllers/tracking/budget_investments_controller.rb +++ b/app/controllers/tracking/budget_investments_controller.rb @@ -8,7 +8,7 @@ class Tracking::BudgetInvestmentsController < Tracking::BaseController before_action :load_budget before_action :load_investment, only: [:show, :edit] - has_orders %w{oldest}, only: [:show, :edit] + has_orders %w[oldest], only: [:show, :edit] load_and_authorize_resource :investment, class: "Budget::Investment" diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 905bcf8c8..690b74f68 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,5 +1,5 @@ class UsersController < ApplicationController - has_filters %w{proposals debates budget_investments comments follows}, only: :show + has_filters %w[proposals debates budget_investments comments follows], only: :show load_and_authorize_resource helper_method :author? diff --git a/app/controllers/valuation/budget_investments_controller.rb b/app/controllers/valuation/budget_investments_controller.rb index 66398f14f..6c33a2766 100644 --- a/app/controllers/valuation/budget_investments_controller.rb +++ b/app/controllers/valuation/budget_investments_controller.rb @@ -9,8 +9,8 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController before_action :load_budget before_action :load_investment, only: [:show, :edit, :valuate] - has_orders %w{oldest}, only: [:show, :edit] - has_filters %w{valuating valuation_finished}, only: :index + has_orders %w[oldest], only: [:show, :edit] + has_filters %w[valuating valuation_finished], only: :index load_and_authorize_resource :investment, class: "Budget::Investment" diff --git a/app/models/activity.rb b/app/models/activity.rb index ed617c97a..1bc3851b8 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -2,7 +2,7 @@ class Activity < ApplicationRecord belongs_to :actionable, -> { with_hidden }, polymorphic: true belongs_to :user, -> { with_hidden } - VALID_ACTIONS = %w(hide block restore valuate email) + VALID_ACTIONS = %w[hide block restore valuate email] validates :action, inclusion: {in: VALID_ACTIONS} diff --git a/app/models/budget.rb b/app/models/budget.rb index c4fe62eeb..5928209cf 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -20,7 +20,7 @@ class Budget < ApplicationRecord end end - CURRENCY_SYMBOLS = %w(€ $ £ ¥).freeze + CURRENCY_SYMBOLS = %w[€ $ £ ¥].freeze validates_translation :name, presence: true validates :phase, inclusion: { in: Budget::Phase::PHASE_KINDS } @@ -173,13 +173,13 @@ class Budget < ApplicationRecord def investments_orders case phase when "accepting", "reviewing" - %w{random} + %w[random] when "publishing_prices", "balloting", "reviewing_ballots" - %w{random price} + %w[random price] when "finished" - %w{random} + %w[random] else - %w{random confidence_score} + %w[random confidence_score] end end diff --git a/app/models/budget/phase.rb b/app/models/budget/phase.rb index 56d125d1d..ccaf2f78d 100644 --- a/app/models/budget/phase.rb +++ b/app/models/budget/phase.rb @@ -1,8 +1,8 @@ class Budget class Phase < ApplicationRecord - PHASE_KINDS = %w(drafting informing accepting reviewing selecting valuating publishing_prices balloting - reviewing_ballots finished).freeze - PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze + PHASE_KINDS = %w[drafting informing accepting reviewing selecting valuating publishing_prices balloting + reviewing_ballots finished].freeze + PUBLISHED_PRICES_PHASES = %w[publishing_prices balloting reviewing_ballots finished].freeze SUMMARY_MAX_LENGTH = 1000 DESCRIPTION_MAX_LENGTH = 2000 diff --git a/app/models/budget/reclassified_vote.rb b/app/models/budget/reclassified_vote.rb index 6fceb4707..6b3ad99d8 100644 --- a/app/models/budget/reclassified_vote.rb +++ b/app/models/budget/reclassified_vote.rb @@ -1,6 +1,6 @@ class Budget class ReclassifiedVote < ApplicationRecord - REASONS = %w(heading_changed unfeasible) + REASONS = %w[heading_changed unfeasible] belongs_to :user belongs_to :investment diff --git a/app/models/debate.rb b/app/models/debate.rb index b3a23200a..152059eaf 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -161,7 +161,7 @@ class Debate < ApplicationRecord end def self.debates_orders(user) - orders = %w{hot_score confidence_score created_at relevance} + orders = %w[hot_score confidence_score created_at relevance] orders << "recommendations" if Setting["feature.user.recommendations_on_debates"] && user&.recommended_debates return orders end diff --git a/app/models/legislation/draft_version.rb b/app/models/legislation/draft_version.rb index 57f1039a4..56a42fd07 100644 --- a/app/models/legislation/draft_version.rb +++ b/app/models/legislation/draft_version.rb @@ -1,5 +1,5 @@ class Legislation::DraftVersion < ApplicationRecord - VALID_STATUSES = %w(draft published) + VALID_STATUSES = %w[draft published] acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases diff --git a/app/models/poll/partial_result.rb b/app/models/poll/partial_result.rb index 036e80b75..23821bd60 100644 --- a/app/models/poll/partial_result.rb +++ b/app/models/poll/partial_result.rb @@ -1,6 +1,6 @@ class Poll::PartialResult < ApplicationRecord - VALID_ORIGINS = %w{web booth} + VALID_ORIGINS = %w[web booth] belongs_to :question, -> { with_hidden } belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id" diff --git a/app/models/poll/recount.rb b/app/models/poll/recount.rb index 9cd744cc0..56fe36889 100644 --- a/app/models/poll/recount.rb +++ b/app/models/poll/recount.rb @@ -1,6 +1,6 @@ class Poll::Recount < ApplicationRecord - VALID_ORIGINS = %w{web booth letter}.freeze + VALID_ORIGINS = %w[web booth letter].freeze belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id" belongs_to :booth_assignment diff --git a/app/models/related_content.rb b/app/models/related_content.rb index 4a74ba3c7..1ac79beec 100644 --- a/app/models/related_content.rb +++ b/app/models/related_content.rb @@ -1,6 +1,6 @@ class RelatedContent < ApplicationRecord RELATED_CONTENT_SCORE_THRESHOLD = Setting["related_content_score_threshold"].to_f - RELATIONABLE_MODELS = %w{proposals debates budgets investments}.freeze + RELATIONABLE_MODELS = %w[proposals debates budgets investments].freeze acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases diff --git a/app/models/signature.rb b/app/models/signature.rb index a3b58fc08..584f69567 100644 --- a/app/models/signature.rb +++ b/app/models/signature.rb @@ -93,7 +93,7 @@ class Signature < ApplicationRecord end def document_types - %w(1 2 3 4) + %w[1 2 3 4] end end diff --git a/app/models/signature_sheet.rb b/app/models/signature_sheet.rb index c7d102dca..beaeb4caa 100644 --- a/app/models/signature_sheet.rb +++ b/app/models/signature_sheet.rb @@ -2,7 +2,7 @@ class SignatureSheet < ApplicationRecord belongs_to :signable, polymorphic: true belongs_to :author, class_name: "User", foreign_key: "author_id" - VALID_SIGNABLES = %w(Proposal Budget::Investment) + VALID_SIGNABLES = %w[Proposal Budget::Investment] has_many :signatures diff --git a/app/models/widget/feed.rb b/app/models/widget/feed.rb index 553d35db6..c0a18cfc4 100644 --- a/app/models/widget/feed.rb +++ b/app/models/widget/feed.rb @@ -1,7 +1,7 @@ class Widget::Feed < ApplicationRecord self.table_name = "widget_feeds" - KINDS = %w(proposals debates processes) + KINDS = %w[proposals debates processes] def active? setting.value.present? diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index e535c9d44..fa135908b 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -58,7 +58,7 @@ <%= t("admin.menu.title_booths") %> @@ -90,7 +90,7 @@ <% end %> - <% messages_sections = %w(newsletters emails_download admin_notifications system_emails) %> + <% messages_sections = %w[newsletters emails_download admin_notifications system_emails] %> <% messages_menu_active = messages_sections.include?(controller_name) %>
  • > diff --git a/config/deploy.rb b/config/deploy.rb index 602e86ae1..9501436a2 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -21,8 +21,8 @@ set :log_level, :info set :pty, true set :use_sudo, false -set :linked_files, %w{config/database.yml config/secrets.yml config/unicorn.rb config/environments/production.rb} -set :linked_dirs, %w{log tmp public/system public/assets public/ckeditor_assets} +set :linked_files, %w[config/database.yml config/secrets.yml config/unicorn.rb config/environments/production.rb] +set :linked_dirs, %w[log tmp public/system public/assets public/ckeditor_assets] set :keep_releases, 5 @@ -31,12 +31,12 @@ set :local_user, ENV["USER"] set :delayed_job_workers, 2 set :delayed_job_roles, :background -set(:config_files, %w( +set(:config_files, %w[ log_rotation database.yml secrets.yml unicorn.rb -)) +]) set :whenever_roles, -> { :app } diff --git a/config/deploy/preproduction.rb b/config/deploy/preproduction.rb index 27fdf021d..f7b2ade9f 100644 --- a/config/deploy/preproduction.rb +++ b/config/deploy/preproduction.rb @@ -6,5 +6,5 @@ set :ssh_options, port: deploysecret(:ssh_port) set :stage, :preproduction set :rails_env, :preproduction -server deploysecret(:server1), user: deploysecret(:user), roles: %w(web app db importer cron background) -server deploysecret(:server2), user: deploysecret(:user), roles: %w(web app db importer) +server deploysecret(:server1), user: deploysecret(:user), roles: %w[web app db importer cron background] +server deploysecret(:server2), user: deploysecret(:user), roles: %w[web app db importer] diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 14ae536ac..6f1524a8c 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -6,7 +6,7 @@ set :ssh_options, port: deploysecret(:ssh_port) set :stage, :production set :rails_env, :production -server deploysecret(:server1), user: deploysecret(:user), roles: %w(web app db importer cron background) +server deploysecret(:server1), user: deploysecret(:user), roles: %w[web app db importer cron background] #server deploysecret(:server2), user: deploysecret(:user), roles: %w(web app db importer cron background) #server deploysecret(:server3), user: deploysecret(:user), roles: %w(web app db importer) #server deploysecret(:server4), user: deploysecret(:user), roles: %w(web app db importer) diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb index 8fc1b4630..fe873d00e 100644 --- a/config/deploy/staging.rb +++ b/config/deploy/staging.rb @@ -6,4 +6,4 @@ set :ssh_options, port: deploysecret(:ssh_port) set :stage, :staging set :rails_env, :staging -server deploysecret(:server), user: deploysecret(:user), roles: %w(web app db importer cron) +server deploysecret(:server), user: deploysecret(:user), roles: %w[web app db importer cron] diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 30f4b1bf7..1a326e763 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -9,12 +9,12 @@ Rails.application.config.assets.version = "1.0" # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails.application.config.assets.precompile += %w( search.js ) -Rails.application.config.assets.precompile += %w( ckeditor/config.js ) -Rails.application.config.assets.precompile += %w( ie_lt9.js ) -Rails.application.config.assets.precompile += %w( stat_graphs.js ) -Rails.application.config.assets.precompile += %w( dashboard_graphs.js ) -Rails.application.config.assets.precompile += %w( print.css ) -Rails.application.config.assets.precompile += %w( ie.css ) -Rails.application.config.assets.precompile += %w( pdf_fonts.css ) +Rails.application.config.assets.precompile += %w[ckeditor/config.js] +Rails.application.config.assets.precompile += %w[ie_lt9.js] +Rails.application.config.assets.precompile += %w[stat_graphs.js] +Rails.application.config.assets.precompile += %w[dashboard_graphs.js] +Rails.application.config.assets.precompile += %w[print.css] +Rails.application.config.assets.precompile += %w[ie.css] +Rails.application.config.assets.precompile += %w[pdf_fonts.css] # Loads custom images and custom fonts before app/assets/images and app/assets/fonts diff --git a/config/initializers/social_share_button.rb b/config/initializers/social_share_button.rb index 6ee0fa0ed..f28cd2933 100644 --- a/config/initializers/social_share_button.rb +++ b/config/initializers/social_share_button.rb @@ -1,3 +1,3 @@ SocialShareButton.configure do |config| - config.allow_sites = %w(twitter facebook google_plus telegram) + config.allow_sites = %w[twitter facebook google_plus telegram] end diff --git a/config/spring.rb b/config/spring.rb index c9119b40c..9fa7863f9 100644 --- a/config/spring.rb +++ b/config/spring.rb @@ -1,6 +1,6 @@ -%w( +%w[ .ruby-version .rbenv-vars tmp/restart.txt tmp/caching-dev.txt -).each { |path| Spring.watch(path) } +].each { |path| Spring.watch(path) } diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index e61b9e056..d45599d68 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -944,7 +944,7 @@ describe "Budget Investments" do scenario "Show up to 5 suggestions", :js do login_as(author) - %w(first second third fourth fifth sixth).each do |ordinal| + %w[first second third fourth fifth sixth].each do |ordinal| create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget) end create(factory, title: "This is the last #{factory}", budget: budget) @@ -960,7 +960,7 @@ describe "Budget Investments" do scenario "No found suggestions", :js do login_as(author) - %w(first second third fourth fifth sixth).each do |ordinal| + %w[first second third fourth fifth sixth].each do |ordinal| create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget) end @@ -975,7 +975,7 @@ describe "Budget Investments" do scenario "Don't show suggestions from a different budget", :js do login_as(author) - %w(first second third fourth fifth sixth).each do |ordinal| + %w[first second third fourth fifth sixth].each do |ordinal| create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget) end diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 4a6c3b4de..4f8a1c904 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -890,7 +890,7 @@ describe "Proposals" do expect(page).not_to have_content archived_proposal.title end - orders = %w{hot_score confidence_score created_at relevance} + orders = %w[hot_score confidence_score created_at relevance] orders.each do |order| visit proposals_path(order: order) diff --git a/spec/lib/document_parser_spec.rb b/spec/lib/document_parser_spec.rb index 631983abc..d4b2d34da 100644 --- a/spec/lib/document_parser_spec.rb +++ b/spec/lib/document_parser_spec.rb @@ -23,7 +23,7 @@ describe DocumentParser do end it "adds upper and lowercase letter when the letter is present" do - expect(DocumentParser.get_document_number_variants(1, "1234567A")).to eq(%w(1234567 01234567 1234567a 1234567A 01234567a 01234567A)) + expect(DocumentParser.get_document_number_variants(1, "1234567A")).to eq(%w[1234567 01234567 1234567a 1234567A 01234567a 01234567A]) end end diff --git a/spec/lib/tag_sanitizer_spec.rb b/spec/lib/tag_sanitizer_spec.rb index db269dddd..dc7c9e626 100644 --- a/spec/lib/tag_sanitizer_spec.rb +++ b/spec/lib/tag_sanitizer_spec.rb @@ -22,7 +22,7 @@ describe TagSanitizer do describe "#sanitize_tag_list" do it "returns a new tag list with sanitized tags" do - expect(subject.sanitize_tag_list(%w{x=1 y?z})).to eq(%w(x1 yz)) + expect(subject.sanitize_tag_list(%w[x=1 y?z])).to eq(%w[x1 yz]) end end