Skip to content

Commit

Permalink
Check for updates since submitted or 40 days
Browse files Browse the repository at this point in the history
  Which ever is closest to now
  • Loading branch information
inulty-dfe committed Oct 17, 2023
1 parent f451ab1 commit 751e665
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/application_choice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,12 @@ def supplementary_statuses
end
end

# rename to updated since submitted
def updated_recently?
return false if sent_to_provider_at.blank?
return false if sent_to_provider_at >= updated_at

RecentlyUpdatedApplicationForm.new.call(application_choice_id: id, since: UPDATED_RECENTLY_DAYS.days.ago).exists?
since = [UPDATED_RECENTLY_DAYS.days.ago, sent_to_provider_at].max
RecentlyUpdatedApplicationForm.new.call(application_choice_id: id, since: since).exists?
end

private
Expand Down

0 comments on commit 751e665

Please sign in to comment.