From dfcde06ece444bd8487279a3363c6748d5affe5a Mon Sep 17 00:00:00 2001 From: Edouard CHIN Date: Mon, 3 Dec 2018 19:35:12 +0100 Subject: [PATCH] Fix conditional that checks if ActiveRecord is `< 5.0.2`: - The conditional wasn't correct, any version with a `0` minor and `< 2` patch (which is true for 6.0.0) would return that the version was `< 5.0.2`. --- lib/paper_trail/type_serializers/postgres_array_serializer.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/paper_trail/type_serializers/postgres_array_serializer.rb b/lib/paper_trail/type_serializers/postgres_array_serializer.rb index b0c1247e4..e93964612 100644 --- a/lib/paper_trail/type_serializers/postgres_array_serializer.rb +++ b/lib/paper_trail/type_serializers/postgres_array_serializer.rb @@ -29,8 +29,7 @@ def deserialize(array) private def active_record_pre_502? - ::ActiveRecord::VERSION::MAJOR < 5 || - (::ActiveRecord::VERSION::MINOR.zero? && ::ActiveRecord::VERSION::TINY < 2) + ::ActiveRecord.version < Gem::Version.new('5.0.2') end def serialize_with_ar(array)