fixes ambiguous db query
This commit is contained in:
@@ -6,9 +6,9 @@ class Organization < ActiveRecord::Base
|
||||
|
||||
delegate :email, :phone_number, to: :user
|
||||
|
||||
scope :pending, -> { where(verified_at: nil, rejected_at: nil) }
|
||||
scope :verified, -> { where("verified_at is not null and (rejected_at is null or rejected_at < verified_at)") }
|
||||
scope :rejected, -> { where("rejected_at is not null and (verified_at is null or verified_at < rejected_at)") }
|
||||
scope :pending, -> { where('organizations.verified_at is null and rejected_at is null') }
|
||||
scope :verified, -> { where("organizations.verified_at is not null and (rejected_at is null or rejected_at < organizations.verified_at)") }
|
||||
scope :rejected, -> { where("rejected_at is not null and (organizations.verified_at is null or organizations.verified_at < rejected_at)") }
|
||||
|
||||
def verify
|
||||
update(verified_at: Time.now)
|
||||
|
||||
Reference in New Issue
Block a user