Remove unused argument from AccountMigration.within_cooldown
(#31892)
This commit is contained in:
parent
353ade767b
commit
49cbee3836
1 changed files with 5 additions and 1 deletions
|
@ -31,10 +31,14 @@ class AccountMigration < ApplicationRecord
|
||||||
validate :validate_migration_cooldown
|
validate :validate_migration_cooldown
|
||||||
validate :validate_target_account
|
validate :validate_target_account
|
||||||
|
|
||||||
scope :within_cooldown, ->(now = Time.now.utc) { where(arel_table[:created_at].gteq(now - COOLDOWN_PERIOD)) }
|
scope :within_cooldown, -> { where(created_at: cooldown_duration_ago..) }
|
||||||
|
|
||||||
attr_accessor :current_password, :current_username
|
attr_accessor :current_password, :current_username
|
||||||
|
|
||||||
|
def self.cooldown_duration_ago
|
||||||
|
Time.current - COOLDOWN_PERIOD
|
||||||
|
end
|
||||||
|
|
||||||
def save_with_challenge(current_user)
|
def save_with_challenge(current_user)
|
||||||
if current_user.encrypted_password.present?
|
if current_user.encrypted_password.present?
|
||||||
errors.add(:current_password, :invalid) unless current_user.valid_password?(current_password)
|
errors.add(:current_password, :invalid) unless current_user.valid_password?(current_password)
|
||||||
|
|
Loading…
Reference in a new issue