2018-07-25 05:30:33 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-28 09:17:42 -04:00
|
|
|
class SpamLog < ApplicationRecord
|
2016-01-09 14:30:34 -05:00
|
|
|
belongs_to :user
|
|
|
|
|
|
|
|
validates :user, presence: true
|
2016-01-26 16:20:01 -05:00
|
|
|
|
2017-04-16 17:54:41 -04:00
|
|
|
def remove_user(deleted_by:)
|
2017-06-02 09:18:24 -04:00
|
|
|
user.delete_async(deleted_by: deleted_by, params: { hard_delete: true })
|
2016-01-26 16:20:01 -05:00
|
|
|
end
|
2016-08-01 13:14:03 -04:00
|
|
|
|
|
|
|
def text
|
|
|
|
[title, description].join("\n")
|
|
|
|
end
|
2020-01-23 10:08:46 -05:00
|
|
|
|
|
|
|
def self.verify_recaptcha!(id:, user_id:)
|
|
|
|
find_by(id: id, user_id: user_id)&.update!(recaptcha_verified: true)
|
|
|
|
end
|
2016-01-09 14:30:34 -05:00
|
|
|
end
|