Apply Layout/LineLength rubocop rule
Note we're excluding a few files: * Configuration files that weren't generated by us * Migration files that weren't generated by us * The Gemfile, since it includes an important comment that must be on the same line as the gem declaration * The Budget::Stats class, since the heading statistics are a mess and having shorter lines would require a lot of refactoring
This commit is contained in:
@@ -12,8 +12,13 @@ class Organization < ApplicationRecord
|
||||
delegate :email, :phone_number, to: :user
|
||||
|
||||
scope :pending, -> { where(verified_at: nil, rejected_at: nil) }
|
||||
scope :verified, -> { where.not(verified_at: nil).where("(rejected_at IS NULL or rejected_at < organizations.verified_at)") }
|
||||
scope :rejected, -> { where.not(rejected_at: nil).where("(organizations.verified_at IS NULL or organizations.verified_at < rejected_at)") }
|
||||
scope :verified, -> do
|
||||
where.not(verified_at: nil).where("(rejected_at IS NULL or rejected_at < organizations.verified_at)")
|
||||
end
|
||||
scope :rejected, -> do
|
||||
where.not(rejected_at: nil)
|
||||
.where("(organizations.verified_at IS NULL or organizations.verified_at < rejected_at)")
|
||||
end
|
||||
|
||||
def verify
|
||||
update(verified_at: Time.current)
|
||||
@@ -33,7 +38,8 @@ class Organization < ApplicationRecord
|
||||
|
||||
def self.search(text)
|
||||
if text.present?
|
||||
joins(:user).where("users.email = ? OR users.phone_number = ? OR organizations.name ILIKE ?", text, text, "%#{text}%")
|
||||
joins(:user).where("users.email = ? OR users.phone_number = ? OR organizations.name ILIKE ?",
|
||||
text, text, "%#{text}%")
|
||||
else
|
||||
none
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user