From 88c70366a7f4d6c0645d3bb9122fbd408ddacf71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 26 Oct 2019 13:52:27 +0200 Subject: [PATCH] Apply rubocop rules for trailing commas --- .rubocop.yml | 6 ++++++ app/models/debate.rb | 2 +- app/models/votation_type.rb | 2 +- config/routes/devise.rb | 2 +- ...0801140800_add_collaborative_legislation_translations.rb | 2 +- spec/models/concerns/globalizable.rb | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 398f75b46..255a9f392 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -423,3 +423,9 @@ Style/StringLiteralsInInterpolation: Style/SymbolProc: Enabled: true + +Style/TrailingCommaInArrayLiteral: + Enabled: true + +Style/TrailingCommaInHashLiteral: + Enabled: true diff --git a/app/models/debate.rb b/app/models/debate.rb index 84f08c6c0..756563007 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -74,7 +74,7 @@ class Debate < ApplicationRecord { author.username => "B", tag_list.join(" ") => "B", - geozone&.name => "B", + geozone&.name => "B" }.merge!(searchable_globalized_values) end diff --git a/app/models/votation_type.rb b/app/models/votation_type.rb index 661a2a2bf..b56b6251c 100644 --- a/app/models/votation_type.rb +++ b/app/models/votation_type.rb @@ -21,7 +21,7 @@ class VotationType < ApplicationRecord answer_set_open: { enum_type: 7, open_answer: true, prioritized: false, variables: [:max_votes, :max_groups_answers] }, answer_set_closed: { enum_type: 8, open_answer: false, prioritized: false, - variables: [:max_votes, :max_groups_answers] }, + variables: [:max_votes, :max_groups_answers] } }.freeze enum enum_type: ENUM_TYPES_PROPS.map { |k, v| [k, v[:enum_type]] }.to_h.freeze diff --git a/config/routes/devise.rb b/config/routes/devise.rb index cb60483e4..cfd281409 100644 --- a/config/routes/devise.rb +++ b/config/routes/devise.rb @@ -18,7 +18,7 @@ end devise_for :organizations, class_name: "User", controllers: { registrations: "organizations/registrations", - sessions: "devise/sessions", + sessions: "devise/sessions" }, skip: [:omniauth_callbacks] diff --git a/db/migrate/20180801140800_add_collaborative_legislation_translations.rb b/db/migrate/20180801140800_add_collaborative_legislation_translations.rb index 50fb8fea4..7dc385f77 100644 --- a/db/migrate/20180801140800_add_collaborative_legislation_translations.rb +++ b/db/migrate/20180801140800_add_collaborative_legislation_translations.rb @@ -5,7 +5,7 @@ class AddCollaborativeLegislationTranslations < ActiveRecord::Migration[4.2] title: :string, summary: :text, description: :text, - additional_info: :text, + additional_info: :text }, { migrate_data: true } ) diff --git a/spec/models/concerns/globalizable.rb b/spec/models/concerns/globalizable.rb index c72de6499..dce50d4af 100644 --- a/spec/models/concerns/globalizable.rb +++ b/spec/models/concerns/globalizable.rb @@ -141,7 +141,7 @@ shared_examples_for "globalizable" do |factory_name| record.translations_attributes = [ { id: record.translations.find_by(locale: :es).id, attribute => "" }, - { id: record.translations.find_by(locale: :en).id, _destroy: true }, + { id: record.translations.find_by(locale: :en).id, _destroy: true } ] expect(record).not_to be_valid