Skip to content

Commit c4d8a8a

Browse files
Merge pull request #776 from Shopify/default-serializers
Use the newer `serialize` signature of Rails 7.1 if available
2 parents 3ab98c0 + e2fd841 commit c4d8a8a

File tree

1 file changed

+7
-2
lines changed
  • app/models/maintenance_tasks

1 file changed

+7
-2
lines changed

app/models/maintenance_tasks/run.rb

+7-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,13 @@ class Run < ApplicationRecord
4646

4747
attr_readonly :task_name
4848

49-
serialize :backtrace
50-
serialize :arguments, JSON
49+
if Rails.gem_version >= Gem::Version.new("7.1.alpha")
50+
serialize :backtrace, coder: YAML
51+
serialize :arguments, coder: JSON
52+
else
53+
serialize :backtrace
54+
serialize :arguments, JSON
55+
end
5156

5257
scope :active, -> { where(status: ACTIVE_STATUSES) }
5358
scope :completed, -> { where(status: COMPLETED_STATUSES) }

0 commit comments

Comments
 (0)