mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-17 15:53:16 +00:00
Use attribute for User#external? (#35579)
This commit is contained in:
parent
fd779c25b9
commit
15b72591d4
1 changed files with 3 additions and 5 deletions
|
|
@ -143,7 +143,9 @@ class User < ApplicationRecord
|
|||
delegate :can?, to: :role
|
||||
|
||||
attr_reader :invite_code, :date_of_birth
|
||||
attr_writer :external, :bypass_registration_checks, :current_account
|
||||
attr_writer :bypass_registration_checks, :current_account
|
||||
|
||||
attribute :external, :boolean, default: false
|
||||
|
||||
def self.those_who_can(*any_of_privileges)
|
||||
matching_role_ids = UserRole.that_can(*any_of_privileges).map(&:id)
|
||||
|
|
@ -507,10 +509,6 @@ class User < ApplicationRecord
|
|||
Setting.registrations_mode == 'open'
|
||||
end
|
||||
|
||||
def external?
|
||||
!!@external
|
||||
end
|
||||
|
||||
def bypass_registration_checks?
|
||||
@bypass_registration_checks
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue