chore(rubocop): fix Rails/ExpandedDateRange

This commit is contained in:
Colin Darie 2023-04-19 11:01:27 +02:00
parent 999f06075b
commit 160178b8f8
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
12 changed files with 12 additions and 12 deletions

View file

@ -14,6 +14,6 @@ class Cron::Datagouv::AccountByMonthJob < Cron::CronJob
end
def data
User.where(created_at: 1.month.ago.beginning_of_month..1.month.ago.end_of_month).count
User.where(created_at: 1.month.ago.all_month).count
end
end

View file

@ -14,6 +14,6 @@ class Cron::Datagouv::AdministrateurByMonthJob < Cron::CronJob
end
def data
Administrateur.where(created_at: 1.month.ago.beginning_of_month..1.month.ago.end_of_month).count
Administrateur.where(created_at: 1.month.ago.all_month).count
end
end

View file

@ -14,6 +14,6 @@ class Cron::Datagouv::FileByMonthJob < Cron::CronJob
end
def data
Dossier.where(created_at: 1.month.ago.beginning_of_month..1.month.ago.end_of_month).count
Dossier.where(created_at: 1.month.ago.all_month).count
end
end

View file

@ -14,6 +14,6 @@ class Cron::Datagouv::FileDeposeByMonthJob < Cron::CronJob
end
def data
Dossier.where(depose_at: 1.month.ago.beginning_of_month..1.month.ago.end_of_month).count
Dossier.where(depose_at: 1.month.ago.all_month).count
end
end

View file

@ -14,6 +14,6 @@ class Cron::Datagouv::InstructeurByMonthJob < Cron::CronJob
end
def data
Instructeur.where(created_at: 1.month.ago.beginning_of_month..1.month.ago.end_of_month).count
Instructeur.where(created_at: 1.month.ago.all_month).count
end
end

View file

@ -14,6 +14,6 @@ class Cron::Datagouv::InstructeurConnectedByMonthJob < Cron::CronJob
end
def data
Instructeur.joins(:user).where(user: { last_sign_in_at: 1.month.ago.beginning_of_month..1.month.ago.end_of_month }).count
Instructeur.joins(:user).where(user: { last_sign_in_at: 1.month.ago.all_month }).count
end
end

View file

@ -14,6 +14,6 @@ class Cron::Datagouv::ProcedureByMonthJob < Cron::CronJob
end
def data
Procedure.where(created_at: 1.month.ago.beginning_of_month..1.month.ago.end_of_month).count
Procedure.where(created_at: 1.month.ago.all_month).count
end
end

View file

@ -14,6 +14,6 @@ class Cron::Datagouv::ProcedureClosedByMonthJob < Cron::CronJob
end
def data
Procedure.where(closed_at: 1.month.ago.beginning_of_month..1.month.ago.end_of_month).count
Procedure.where(closed_at: 1.month.ago.all_month).count
end
end

View file

@ -14,6 +14,6 @@ class Cron::Datagouv::ProcedureDeletedByMonthJob < Cron::CronJob
end
def data
Procedure.where(hidden_at: 1.month.ago.beginning_of_month..1.month.ago.end_of_month).count
Procedure.where(hidden_at: 1.month.ago.all_month).count
end
end

View file

@ -14,6 +14,6 @@ class Cron::Datagouv::UserConnectedWithFranceConnectByMonthJob < Cron::CronJob
end
def data
User.where(created_at: 1.month.ago.beginning_of_month..1.month.ago.end_of_month, loged_in_with_france_connect: "particulier").count
User.where(created_at: 1.month.ago.all_month, loged_in_with_france_connect: "particulier").count
end
end

View file

@ -281,7 +281,7 @@ class Dossier < ApplicationRecord
scope :processed_in_month, -> (date) do
date = date.to_datetime
state_termine
.where(processed_at: date.beginning_of_month..date.end_of_month)
.where(processed_at: date.all_month)
end
scope :ordered_for_export, -> {
order(depose_at: 'asc')

View file

@ -208,7 +208,7 @@ class Instructeur < ApplicationRecord
h = {
nb_en_construction: groupe.dossiers.visible_by_administration.en_construction.count,
nb_en_instruction: groupe.dossiers.visible_by_administration.en_instruction.count,
nb_accepted: Traitement.where(dossier: groupe.dossiers.accepte, processed_at: Time.zone.yesterday.beginning_of_day..Time.zone.yesterday.end_of_day).count,
nb_accepted: Traitement.where(dossier: groupe.dossiers.accepte, processed_at: Time.zone.yesterday.all_day).count,
nb_notification: nb_notification
}