app/controllers/context_steps_controller.rb
# Created a list of users that are either admins or managers of previously selected sites
Created a list of users that are either admins or managers of previously selected sites
Created a list of users that are either admins or managers of previously selected sites
def permitted_owners
    @permitted_owners = User.
      joins('LEFT JOIN user_site_associations usa ON usa.user_id = users.id').
      where(['(usa.site_id IN (?) AND usa.role = ?) OR admin', @context.sites.map(&:id), UserType::ADMIN]).
      distinct.order(:name)
  end
def permitted_owners @permitted_owners = User . joins ( 'LEFT JOIN user_site_associations usa ON usa.user_id = users.id' ) . where ( [ '(usa.site_id IN (?) AND usa.role = ?) OR admin' , @context . sites . map ( & :id ) , UserType :: ADMIN ] ) . distinct . order ( :name ) end
Created a list of users that are either admins or managers of previously selected sites
Created a list of users that are either admins or managers of previously selected sites