diff --git a/app/controllers/manager/team_accounts_controller.rb b/app/controllers/manager/team_accounts_controller.rb index 00997569e..633bc2fa6 100644 --- a/app/controllers/manager/team_accounts_controller.rb +++ b/app/controllers/manager/team_accounts_controller.rb @@ -2,7 +2,8 @@ module Manager class TeamAccountsController < Manager::ApplicationController def index @records_per_page = params[:records_per_page] || "10" - resources = User.marked_as_team_account + resources = User + .where(team_account: true) .order(created_at: :asc) .page(params[:_page]) .per(@records_per_page) diff --git a/app/models/user.rb b/app/models/user.rb index 6c829d8b3..5d6589829 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -62,7 +62,6 @@ class User < ApplicationRecord accepts_nested_attributes_for :france_connect_information default_scope { eager_load(:instructeur, :administrateur, :expert) } - scope :marked_as_team_account, -> { where('email ilike ?', "%@beta.gouv.fr") } before_validation -> { sanitize_email(:email) } validate :does_not_merge_on_self, if: :requested_merge_into_id_changed?