From 8896d6c1b16cb6edd9b3909f88f2094d022ad478 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 30 Jul 2025 08:55:36 -0400 Subject: [PATCH] Use attribute for `User#bypass_registration_checks?` (#35580) --- app/models/user.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 7da5876af1..ff09acbf79 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -132,9 +132,10 @@ class User < ApplicationRecord delegate :can?, to: :role attr_reader :invite_code, :date_of_birth - attr_writer :bypass_registration_checks, :current_account + attr_writer :current_account attribute :external, :boolean, default: false + attribute :bypass_registration_checks, :boolean, default: false def self.those_who_can(*any_of_privileges) matching_role_ids = UserRole.that_can(*any_of_privileges).map(&:id) @@ -477,10 +478,6 @@ class User < ApplicationRecord Setting.registrations_mode == 'open' end - def bypass_registration_checks? - @bypass_registration_checks - end - def sanitize_role self.role = nil if role.present? && role.everyone? end