Skip to content

Commit

Permalink
For Rails 7.2 or later, use the new syntax for the serialize method (#…
Browse files Browse the repository at this point in the history
…104)

Passing the class as positional argument has removed in Rails 7.2.
https://edgeguides.rubyonrails.org/7_2_release_notes.html#active-record-removals
  • Loading branch information
hidakatsuya authored Sep 3, 2024
1 parent 36f37b3 commit 648d753
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/models/concerns/issue_template_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ module IssueTemplateCommon
end

# ActiveRecord::SerializationTypeMismatch may be thrown if non hash object is assigned.
serialize :builtin_fields_json, Hash
#
# Passing the class as positional argument has removed in Rails 7.2.
# https://edgeguides.rubyonrails.org/7_2_release_notes.html#active-record-removals
if Rails.gem_version >= Gem::Version.new('7.2')
serialize :builtin_fields_json, type: Hash, coder: YAML
else
serialize :builtin_fields_json, Hash
end
end

#
Expand Down

0 comments on commit 648d753

Please sign in to comment.