+ generates_token_for :new_user, :expires_in => 1.week do
+ fingerprint
+ end
+
+ generates_token_for :new_email, :expires_in => 1.week do
+ fingerprint
+ end
+
+ generates_token_for :password_reset, :expires_in => 1.week do
+ fingerprint
+ end
+
+ def display_name_cannot_be_user_id_with_other_id
+ display_name&.match(/^user_(\d+)$/i) do |m|
+ errors.add :display_name, I18n.t("activerecord.errors.messages.display_name_is_user_n") unless m[1].to_i == id
+ end
+ end
+