Skip to content

Commit

Permalink
rubocop linting
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleMacPherson committed Jun 18, 2024
1 parent 056d35e commit 020f857
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions app/notifiers/publishers/job_application_data_expiry_notifier.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class Publishers::JobApplicationDataExpiryNotifier < Noticed::Event

deliver_by :database
deliver_by :email, mailer: "Publishers::JobApplicationDataExpiryMailer", method: :job_application_data_expiry
delegate :created_at, to: :record
Expand All @@ -10,26 +9,26 @@ class Publishers::JobApplicationDataExpiryNotifier < Noticed::Event
include GovukLinkHelper
include GovukVisuallyHiddenHelper
include DatesHelper

def message
t("notifications.publishers/job_application_data_expiry_notification.message_html",
link: vacancy_applications_link, date: format_date(data_expiration_date))
end

def timestamp
"#{day(created_at)} at #{format_time(created_at)}"
end

private

def data_expiration_date
(vacancy.expires_at + 1.year).to_date
end

def vacancy
params[:vacancy]
end

def vacancy_applications_link
govuk_link_to vacancy.job_title, organisation_job_job_applications_path(vacancy.id), class: "govuk-link--no-visited-state"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Publishers::JobApplicationReceivedNotifier < Noticed::Event
include GovukLinkHelper
include GovukVisuallyHiddenHelper
include DatesHelper

def message
t("notifications.publishers/job_application_received_notification.message_html",
link: application_link, job_title: vacancy.job_title, organisation: vacancy.organisation_name)
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/data_access_period.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DATA_ACCESS_PERIOD_FOR_PUBLISHERS = 1.year.freeze
DATA_ACCESS_PERIOD_FOR_PUBLISHERS = 1.year.freeze
6 changes: 3 additions & 3 deletions lib/tasks/migrate_notifications.rake
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ namespace :notifications do
recipient_type: notification.recipient_type,
recipient_id: notification.recipient_id,
read_at: notification.read_at,
seen_at: notification.read_at, # Assuming `seen_at` should be the same as `read_at`
seen_at: notification.read_at, # Assuming `seen_at` should be the same as `read_at`
created_at: notification.created_at,
updated_at: notification.updated_at
updated_at: notification.updated_at,
}]

Noticed::Event.create!(attributes)
end
rescue StandardError => e
Expand Down

0 comments on commit 020f857

Please sign in to comment.