|
|
@ -25,6 +25,8 @@ class AccountMigration < ApplicationRecord
|
|
|
|
before_validation :set_target_account
|
|
|
|
before_validation :set_target_account
|
|
|
|
before_validation :set_followers_count
|
|
|
|
before_validation :set_followers_count
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
normalizes :acct, with: ->(acct) { acct.strip.delete_prefix('@') }
|
|
|
|
|
|
|
|
|
|
|
|
validates :acct, presence: true, domain: { acct: true }
|
|
|
|
validates :acct, presence: true, domain: { acct: true }
|
|
|
|
validate :validate_migration_cooldown
|
|
|
|
validate :validate_migration_cooldown
|
|
|
|
validate :validate_target_account
|
|
|
|
validate :validate_target_account
|
|
|
@ -51,10 +53,6 @@ class AccountMigration < ApplicationRecord
|
|
|
|
created_at + COOLDOWN_PERIOD
|
|
|
|
created_at + COOLDOWN_PERIOD
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def acct=(val)
|
|
|
|
|
|
|
|
super(val.to_s.strip.gsub(/\A@/, ''))
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
|
|
def set_target_account
|
|
|
|
def set_target_account
|
|
|
|