mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 20:18:22 +02:00
refactored
This commit is contained in:
parent
d6824bf46c
commit
74efc60139
2 changed files with 4 additions and 4 deletions
|
@ -45,8 +45,8 @@ module Repp
|
||||||
end
|
end
|
||||||
|
|
||||||
def notify_admins
|
def notify_admins
|
||||||
admin_users_emails = User.all.reject { |u| u.roles.nil? }.
|
admin_users_emails = User.all.reject { |u| u.roles.nil? }
|
||||||
select { |u| u.roles.include? 'admin' }.pluck(:email)
|
.select { |u| u.roles.include? 'admin' }.pluck(:email)
|
||||||
|
|
||||||
return if admin_users_emails.empty?
|
return if admin_users_emails.empty?
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,12 @@ class NotifyAccreditationAdminsAndRegistrarsJob < ApplicationJob
|
||||||
private
|
private
|
||||||
|
|
||||||
def prepare_data_month_before
|
def prepare_data_month_before
|
||||||
ApiUser.where("accreditation_expire_date > ? AND accreditation_expire_date < ?",
|
ApiUser.where('accreditation_expire_date > ? AND accreditation_expire_date < ?',
|
||||||
Time.zone.now.beginning_of_day + MONTH_BEFORE,
|
Time.zone.now.beginning_of_day + MONTH_BEFORE,
|
||||||
Time.zone.now.end_of_day + MONTH_BEFORE).includes(:registrar)
|
Time.zone.now.end_of_day + MONTH_BEFORE).includes(:registrar)
|
||||||
end
|
end
|
||||||
|
|
||||||
def prepare_data_expired_data
|
def prepare_data_expired_data
|
||||||
ApiUser.where("accreditation_expire_date < ?", Time.zone.now.beginning_of_day).includes(:registrar)
|
ApiUser.where('accreditation_expire_date < ?', Time.zone.now.beginning_of_day).includes(:registrar)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue