fix(rubocop): Rails/RedundantActiveRecordAllMethod
This commit is contained in:
parent
0da2843f26
commit
6ab3fa1cf4
7 changed files with 8 additions and 8 deletions
|
@ -2,8 +2,8 @@ module Manager
|
|||
class OutdatedProceduresController < Manager::ApplicationController
|
||||
def index
|
||||
@records_per_page = params[:records_per_page] || "10"
|
||||
resources = Procedure.all
|
||||
.where(procedure_expires_when_termine_enabled: false)
|
||||
resources = Procedure.
|
||||
where(procedure_expires_when_termine_enabled: false)
|
||||
.order(created_at: :asc)
|
||||
.page(params[:_page])
|
||||
.per(@records_per_page)
|
||||
|
|
|
@ -9,7 +9,7 @@ class ProcedureRevisionPreloader
|
|||
end
|
||||
|
||||
def self.load_one(revision)
|
||||
ProcedureRevisionPreloader.new([revision]).all.first
|
||||
ProcedureRevisionPreloader.new([revision]).all.first # rubocop:disable Rails/RedundantActiveRecordAllMethod
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class CleanupAssignTosFromBetagouv < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
super_admin_emails = SuperAdmin.all.pluck(:email)
|
||||
super_admin_emails = SuperAdmin.pluck(:email)
|
||||
|
||||
super_admin_emails.each do |email|
|
||||
user = User.find_by(email: email)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class ReaddSuperAdminToTheirProcedureWithoutInstructeur < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
super_admin_emails = SuperAdmin.all.pluck(:email)
|
||||
super_admin_emails = SuperAdmin.pluck(:email)
|
||||
# we want to re-assign each super admin being an admin of a procedure
|
||||
# to every procedure that lost all instructeur
|
||||
# so we cache procedure without instructeur first
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace :after_party do
|
|||
puts "Running deploy task 'fix_dossier_transfer_with_uppercase'"
|
||||
# in production, about 1000, no need to track progress
|
||||
|
||||
DossierTransfer.all.find_each do |dt|
|
||||
DossierTransfer.find_each do |dt|
|
||||
if /A-Z/.match?(dt.email)
|
||||
dt.email = dt.email.downcase
|
||||
dt.save
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace :superadmin do
|
|||
EOD
|
||||
task list: :environment do
|
||||
rake_puts "All SuperAdmins:"
|
||||
SuperAdmin.all.pluck(:email).each do |a|
|
||||
SuperAdmin.pluck(:email).each do |a|
|
||||
puts a
|
||||
end
|
||||
end
|
||||
|
|
|
@ -123,7 +123,7 @@ describe Gestionnaires::GroupeGestionnairesController, type: :controller do
|
|||
|
||||
it do
|
||||
subject
|
||||
expect(GroupeGestionnaire.all.count).to eq(1)
|
||||
expect(GroupeGestionnaire.count).to eq(1)
|
||||
expect(response).to redirect_to(gestionnaire_groupe_gestionnaires_path)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue