Fix all Layout/SpaceInLambdaLiteral rubocop issues and remove files from rubocop_todo list
This commit is contained in:
@@ -2,8 +2,8 @@ module Filterable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
scope :by_official_level, -> (official_level) { where(users: { official_level: official_level }).joins(:author) }
|
||||
scope :by_date_range, -> (date_range) { where(created_at: date_range) }
|
||||
scope :by_official_level, ->(official_level) { where(users: { official_level: official_level }).joins(:author) }
|
||||
scope :by_date_range, ->(date_range) { where(created_at: date_range) }
|
||||
end
|
||||
|
||||
class_methods do
|
||||
|
||||
@@ -31,9 +31,9 @@ class SpendingProposal < ActiveRecord::Base
|
||||
scope :not_unfeasible, -> { where("feasible IS ? OR feasible = ?", nil, true) }
|
||||
scope :with_supports, -> { where('cached_votes_up > 0') }
|
||||
|
||||
scope :by_admin, -> (admin) { where(administrator_id: admin.presence) }
|
||||
scope :by_tag, -> (tag_name) { tagged_with(tag_name) }
|
||||
scope :by_valuator, -> (valuator) { where("valuation_assignments.valuator_id = ?", valuator.presence).joins(:valuation_assignments) }
|
||||
scope :by_admin, ->(admin) { where(administrator_id: admin.presence) }
|
||||
scope :by_tag, ->(tag_name) { tagged_with(tag_name) }
|
||||
scope :by_valuator, ->(valuator) { where("valuation_assignments.valuator_id = ?", valuator.presence).joins(:valuation_assignments) }
|
||||
|
||||
scope :for_render, -> { includes(:geozone) }
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class User < ActiveRecord::Base
|
||||
scope :officials, -> { where("official_level > 0") }
|
||||
scope :newsletter, -> { where(newsletter: true) }
|
||||
scope :for_render, -> { includes(:organization) }
|
||||
scope :by_document, -> (document_type, document_number) { where(document_type: document_type, document_number: document_number) }
|
||||
scope :by_document, ->(document_type, document_number) { where(document_type: document_type, document_number: document_number) }
|
||||
scope :email_digest, -> { where(email_digest: true) }
|
||||
scope :active, -> { where(erased_at: nil) }
|
||||
scope :erased, -> { where.not(erased_at: nil) }
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class VerifiedUser < ActiveRecord::Base
|
||||
scope :by_user, -> (user) { where(document_number: user.document_number) }
|
||||
scope :by_user, ->(user) { where(document_number: user.document_number) }
|
||||
|
||||
scope :by_email, -> (email) { where(email: email) }
|
||||
scope :by_phone, -> (phone) { where(phone: phone) }
|
||||
scope :by_email, ->(email) { where(email: email) }
|
||||
scope :by_phone, ->(phone) { where(phone: phone) }
|
||||
|
||||
def self.phone?(user)
|
||||
by_user(user).by_phone(user.unconfirmed_phone).first.present?
|
||||
|
||||
Reference in New Issue
Block a user