Add search for external users
This commit is contained in:
@@ -2,6 +2,7 @@ class Consumer < ApplicationRecord
|
||||
has_many :users
|
||||
|
||||
scope :with_internal_users, -> { where('id IN (SELECT DISTINCT consumer_id FROM internal_users)') }
|
||||
scope :with_external_users, -> { where('id IN (SELECT DISTINCT consumer_id FROM external_users)') }
|
||||
scope :with_study_groups, -> { where('id IN (SELECT DISTINCT consumer_id FROM study_groups)') }
|
||||
|
||||
validates :name, presence: true
|
||||
|
@@ -1,7 +1,7 @@
|
||||
class User < ApplicationRecord
|
||||
self.abstract_class = true
|
||||
|
||||
ROLES = %w(admin teacher)
|
||||
ROLES = %w(admin teacher learner)
|
||||
|
||||
belongs_to :consumer
|
||||
has_many :study_group_memberships, as: :user
|
||||
|
Reference in New Issue
Block a user