Merge pull request #8071 from demarches-simplifiees/update_team_members

feat(manager): affiche les utilisateurs de l'équipe en fonction de la valeur dans l'attribut
This commit is contained in:
LeSim 2022-11-17 16:36:15 +01:00 committed by GitHub
commit 00139af693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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)

View file

@ -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?