Skip to content

Commit

Permalink
Pass coder as keyword argument in AR versions >= 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed Mar 20, 2024
1 parent 60273f8 commit f33c86b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/mobility/backends/active_record/serialized.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ def self.build_node(attr, _locale)

setup do |attributes, options|
coder = { yaml: YAMLCoder, json: JSONCoder }[options[:format]]
attributes.each { |attribute| serialize (options[:column_affix] % attribute), coder }
attributes.each do |attribute|
if (::ActiveRecord::VERSION::STRING >= "7.1")
serialize (options[:column_affix] % attribute), coder: coder
else
serialize (options[:column_affix] % attribute), coder
end
end
end

# @!group Cache Methods
Expand Down

0 comments on commit f33c86b

Please sign in to comment.