Apply rubocop rules for trailing commas

This commit is contained in:
Javi Martín
2019-10-26 13:52:27 +02:00
parent a727dcc031
commit 88c70366a7
6 changed files with 11 additions and 5 deletions

View File

@@ -423,3 +423,9 @@ Style/StringLiteralsInInterpolation:
Style/SymbolProc: Style/SymbolProc:
Enabled: true Enabled: true
Style/TrailingCommaInArrayLiteral:
Enabled: true
Style/TrailingCommaInHashLiteral:
Enabled: true

View File

@@ -74,7 +74,7 @@ class Debate < ApplicationRecord
{ {
author.username => "B", author.username => "B",
tag_list.join(" ") => "B", tag_list.join(" ") => "B",
geozone&.name => "B", geozone&.name => "B"
}.merge!(searchable_globalized_values) }.merge!(searchable_globalized_values)
end end

View File

@@ -21,7 +21,7 @@ class VotationType < ApplicationRecord
answer_set_open: { enum_type: 7, open_answer: true, prioritized: false, answer_set_open: { enum_type: 7, open_answer: true, prioritized: false,
variables: [:max_votes, :max_groups_answers] }, variables: [:max_votes, :max_groups_answers] },
answer_set_closed: { enum_type: 8, open_answer: false, prioritized: false, answer_set_closed: { enum_type: 8, open_answer: false, prioritized: false,
variables: [:max_votes, :max_groups_answers] }, variables: [:max_votes, :max_groups_answers] }
}.freeze }.freeze
enum enum_type: ENUM_TYPES_PROPS.map { |k, v| [k, v[:enum_type]] }.to_h.freeze enum enum_type: ENUM_TYPES_PROPS.map { |k, v| [k, v[:enum_type]] }.to_h.freeze

View File

@@ -18,7 +18,7 @@ end
devise_for :organizations, class_name: "User", devise_for :organizations, class_name: "User",
controllers: { controllers: {
registrations: "organizations/registrations", registrations: "organizations/registrations",
sessions: "devise/sessions", sessions: "devise/sessions"
}, },
skip: [:omniauth_callbacks] skip: [:omniauth_callbacks]

View File

@@ -5,7 +5,7 @@ class AddCollaborativeLegislationTranslations < ActiveRecord::Migration[4.2]
title: :string, title: :string,
summary: :text, summary: :text,
description: :text, description: :text,
additional_info: :text, additional_info: :text
}, },
{ migrate_data: true } { migrate_data: true }
) )

View File

@@ -141,7 +141,7 @@ shared_examples_for "globalizable" do |factory_name|
record.translations_attributes = [ record.translations_attributes = [
{ id: record.translations.find_by(locale: :es).id, attribute => "" }, { 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 expect(record).not_to be_valid