mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +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
|
||||
|
||||
def notify_admins
|
||||
admin_users_emails = User.all.reject { |u| u.roles.nil? }.
|
||||
select { |u| u.roles.include? 'admin' }.pluck(:email)
|
||||
admin_users_emails = User.all.reject { |u| u.roles.nil? }
|
||||
.select { |u| u.roles.include? 'admin' }.pluck(:email)
|
||||
|
||||
return if admin_users_emails.empty?
|
||||
|
||||
|
|
|
@ -25,12 +25,12 @@ class NotifyAccreditationAdminsAndRegistrarsJob < ApplicationJob
|
|||
private
|
||||
|
||||
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.end_of_day + MONTH_BEFORE).includes(:registrar)
|
||||
end
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue