From c4ba35bf639132c7fa16ab40de4a8f208b9acde0 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Wed, 28 Jun 2017 14:27:49 +0200 Subject: [PATCH] Revert rubocop autocorrections and add it to exclusion list on rubocop_todo file --- .rubocop_todo.yml | 8 ++++++++ app/models/concerns/searchable.rb | 17 +++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index fac09b643..a29c06239 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -550,3 +550,11 @@ Style/VariableNumber: Style/WordArray: EnforcedStyle: percent MinSize: 3 + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: braces, no_braces, context_dependent +Style/BracesAroundHashParameters: + Exclude: + - 'app/models/concerns/searchable.rb' diff --git a/app/models/concerns/searchable.rb b/app/models/concerns/searchable.rb index 7de037ca1..6694df114 100644 --- a/app/models/concerns/searchable.rb +++ b/app/models/concerns/searchable.rb @@ -5,14 +5,15 @@ module Searchable include PgSearch include SearchCache - pg_search_scope :pg_search, - against: :ignored, # not used since using a tsvector_column - using: { - tsearch: { tsvector_column: 'tsv', dictionary: "spanish", prefix: true } - }, - ignoring: :accents, - ranked_by: '(:tsearch)', - order_within_rank: (self.column_names.include?('cached_votes_up') ? "#{self.table_name}.cached_votes_up DESC" : nil) + pg_search_scope :pg_search, { + against: :ignored, # not used since using a tsvector_column + using: { + tsearch: { tsvector_column: 'tsv', dictionary: "spanish", prefix: true } + }, + ignoring: :accents, + ranked_by: '(:tsearch)', + order_within_rank: (self.column_names.include?('cached_votes_up') ? "#{self.table_name}.cached_votes_up DESC" : nil) + } end end