From 030f7f5c8dfde66c8000aef11474819de3b9866a Mon Sep 17 00:00:00 2001 From: Theodor Tonum Date: Mon, 27 May 2024 20:40:14 +0200 Subject: [PATCH] Fix deprecated argument in Rails 7.1 and newer Removed in Rails 8.0, see https://github.com/rails/rails/commit/8069cc83e8a508e3f578c49be9007b08e3c5516e --- .../matchers/active_record/serialize_matcher_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/unit/shoulda/matchers/active_record/serialize_matcher_spec.rb b/spec/unit/shoulda/matchers/active_record/serialize_matcher_spec.rb index 7e63b6d1b..65f3e7768 100644 --- a/spec/unit/shoulda/matchers/active_record/serialize_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/active_record/serialize_matcher_spec.rb @@ -68,13 +68,13 @@ def unserialized_model end def with_serialized_attr(type: nil, coder: YAML) - type_or_coder = rails_version >= 7.1 ? nil : type || coder + args = rails_version >= 7.1 ? [] : [type || coder] define_model(:example, attr: :string) do if type - serialize :attr, type_or_coder, type: type, coder: coder + serialize :attr, *args, type: type, coder: coder else - serialize :attr, type_or_coder, coder: coder + serialize :attr, *args, coder: coder end end.new end