Skip to content

Commit

Permalink
Drop stale user scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
ncounter committed Feb 29, 2024
1 parent ba23ab0 commit da4d240
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/api/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ class User < ApplicationRecord
scope :all_without_nobody, -> { where.not(login: NOBODY_LOGIN) }
scope :not_deleted, -> { where.not(state: 'deleted') }
scope :not_locked, -> { where.not(state: 'locked') }
scope :with_login_prefix, ->(prefix) { where('login LIKE ?', "#{prefix}%") }
scope :active, -> { confirmed.or(User.unscoped.where(state: :subaccount, owner: User.unscoped.confirmed)) }
scope :staff, -> { joins(:roles).where('roles.title' => 'Staff') }
scope :not_staff, -> { where.not(id: User.unscoped.staff.pluck(:id)) }
scope :admins, -> { joins(:roles).where('roles.title' => 'Admin') }
scope :moderators, -> { joins(:roles).where('roles.title' => 'Moderator') }

Expand Down

0 comments on commit da4d240

Please sign in to comment.