Add and apply Layout/ExtraSpacing rubocop rule

This commit is contained in:
Javi Martín
2019-10-24 18:11:58 +02:00
parent 033f3c33e3
commit 57ef380379
22 changed files with 29 additions and 26 deletions

View File

@@ -8,7 +8,7 @@ module Ahoy
# Name is the name of the collection and will be showed in the
# chart
def add(name, collection)
collections.push data: collection, name: name
collections.push data: collection, name: name
collection.each_key { |key| add_key key }
end

View File

@@ -154,7 +154,7 @@ class Budget
results = results.search_by_title_or_id(params[:title_or_id].strip) if params[:title_or_id]
results = advanced_filters(params, results) if params[:advanced_filters].present?
results = results.send(current_filter) if current_filter.present?
results = results.send(current_filter) if current_filter.present?
results.includes(:heading, :group, :budget, administrator: :user, valuators: :user)
end

View File

@@ -5,5 +5,5 @@ class Budget::Investment::ChangeLog < ApplicationRecord
validates :new_value, presence: true
validates :field, presence: true
scope :by_investment, ->(investment_id) { where(investment_id: investment_id) }
scope :by_investment, ->(investment_id) { where(investment_id: investment_id) }
end

View File

@@ -7,7 +7,7 @@ class LocalCensusRecord < ApplicationRecord
validates :postal_code, presence: true
validates :document_number, uniqueness: { scope: :document_type }
scope :search, -> (terms) { where("document_number ILIKE ?", "%#{terms}%") }
scope :search, -> (terms) { where("document_number ILIKE ?", "%#{terms}%") }
private

View File

@@ -46,7 +46,7 @@ class Poll < ApplicationRecord
scope :published, -> { where("published = ?", true) }
scope :by_geozone_id, ->(geozone_id) { where(geozones: { id: geozone_id }.joins(:geozones)) }
scope :public_for_api, -> { all }
scope :not_budget, -> { where(budget_id: nil) }
scope :not_budget, -> { where(budget_id: nil) }
scope :created_by_admin, -> { where(related_type: nil) }
def self.sort_for_list

View File

@@ -10,9 +10,9 @@ class ProposalNotification < ApplicationRecord
validates :proposal, presence: true
validate :minimum_interval
scope :public_for_api, -> { where(proposal_id: Proposal.public_for_api.pluck(:id)) }
scope :sort_by_created_at, -> { reorder(created_at: :desc) }
scope :sort_by_moderated, -> { reorder(moderated: :desc) }
scope :public_for_api, -> { where(proposal_id: Proposal.public_for_api.pluck(:id)) }
scope :sort_by_created_at, -> { reorder(created_at: :desc) }
scope :sort_by_moderated, -> { reorder(moderated: :desc) }
scope :moderated, -> { where(moderated: true) }
scope :not_moderated, -> { where(moderated: false) }

View File

@@ -18,7 +18,7 @@ class SiteCustomization::Page < ApplicationRecord
scope :sort_desc, -> { order("id DESC") }
scope :with_more_info_flag, -> { where(status: "published", more_info_flag: true).sort_asc }
scope :with_same_locale, -> { joins(:translations).locale }
scope :locale, -> { where("site_customization_page_translations.locale": I18n.locale) }
scope :locale, -> { where("site_customization_page_translations.locale": I18n.locale) }
def url
"/#{slug}"

View File

@@ -1,6 +1,6 @@
class VotationSetAnswer < ApplicationRecord
belongs_to :votation_type
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
scope :by_author, -> (author) { where(author: author) }
end