mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 13:36:15 +02:00
Created user admin scope
This commit is contained in:
parent
807c537f67
commit
0ad2fd5a1b
2 changed files with 3 additions and 1 deletions
|
@ -58,7 +58,7 @@ module Repp
|
|||
end
|
||||
|
||||
def notify_admins
|
||||
admin_users_emails = User.all.select { |u| u.roles.include? 'admin' }.pluck(:email)
|
||||
admin_users_emails = User.admin.pluck(:email)
|
||||
|
||||
return if admin_users_emails.empty?
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ class User < ApplicationRecord
|
|||
|
||||
has_many :actions, dependent: :restrict_with_exception
|
||||
|
||||
scope :admin, -> { where("'admin' = ANY (roles)") }
|
||||
|
||||
attr_accessor :phone
|
||||
|
||||
self.ignored_columns = %w[legacy_id]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue