diff --git a/lib/paper_trail/has_paper_trail.rb b/lib/paper_trail/has_paper_trail.rb index 041914c4e..3ebd226fd 100644 --- a/lib/paper_trail/has_paper_trail.rb +++ b/lib/paper_trail/has_paper_trail.rb @@ -174,8 +174,8 @@ def paper_trail_on_destroy(recording_order = "before") raise ArgumentError, 'recording order can only be "after" or "before"' end - if recording_order == "after" && - Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("5") + if recording_order.to_s == "after" && + Gem::Version.new(ActiveRecord::VERSION::STRING).release >= Gem::Version.new("5") if ::ActiveRecord::Base.belongs_to_required_by_default ::ActiveSupport::Deprecation.warn( "paper_trail_on_destroy(:after) is incompatible with ActiveRecord " +