mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 01:41:08 +00:00
23 lines
385 B
Ruby
23 lines
385 B
Ruby
# frozen_string_literal: true
|
|
|
|
module User::Confirmation
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
scope :confirmed, -> { where.not(confirmed_at: nil) }
|
|
scope :unconfirmed, -> { where(confirmed_at: nil) }
|
|
|
|
def confirm
|
|
wrap_email_confirmation { super }
|
|
end
|
|
end
|
|
|
|
def confirmed?
|
|
confirmed_at.present?
|
|
end
|
|
|
|
def unconfirmed?
|
|
!confirmed?
|
|
end
|
|
end
|