Add and apply Layout/ExtraSpacing rubocop rule
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) }
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user