Skip to content

Commit

Permalink
Fixes #37846 - Support Rails 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ofedoren committed Sep 20, 2024
1 parent d3e91d8 commit 059a7c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/foreman_tasks/cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def orphaned_dynflow_tasks

def prepare_filter
filter_parts = [filter]
filter_parts << %(started_at < "#{after.ago.to_s(:db)}") if after > 0
filter_parts << %(started_at < "#{after.ago.to_fs(:db)}") if after > 0
filter_parts << "state ^ (#{states.join(',')})" if states.any?
filter_parts.select(&:present?).map { |segment| "(#{segment})" }.join(' AND ')
end
Expand Down
6 changes: 3 additions & 3 deletions lib/foreman_tasks/tasks/export_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@ namespace :foreman_tasks do
SKIP_ERRORS = ['true', '1', 'y', 'yes'].include? (ENV['SKIP_FAILED'] || '').downcase

filter = if ENV['TASK_SEARCH'].nil? && ENV['TASK_DAYS'].nil?
"started_at > \"#{7.days.ago.to_s(:db)}\" || " \
"(result != success && started_at > \"#{60.days.ago.to_s(:db)})\""
"started_at > \"#{7.days.ago.to_fs(:db)}\" || " \
"(result != success && started_at > \"#{60.days.ago.to_fs(:db)})\""
else
ENV['TASK_SEARCH'] || ''
end

if (days = ENV['TASK_DAYS'])
filter += ' && ' unless filter == ''
filter += "started_at > \"#{days.to_i.days.ago.to_s(:db)}\""
filter += "started_at > \"#{days.to_i.days.ago.to_fs(:db)}\""
end

format = ENV['TASK_FORMAT'] || 'html'
Expand Down

0 comments on commit 059a7c4

Please sign in to comment.