From c11635c1251f1741dc50946609ad3ea7b8b678c3 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 4 Oct 2022 20:59:08 -0700 Subject: [PATCH] Added code for to_yaml to Searchkick::Relation - #1591 [skip ci] --- lib/searchkick/relation.rb | 5 +++++ test/relation_test.rb | 6 ++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/lib/searchkick/relation.rb b/lib/searchkick/relation.rb index f9e2d3b..4bd2798 100644 --- a/lib/searchkick/relation.rb +++ b/lib/searchkick/relation.rb @@ -199,6 +199,11 @@ module Searchkick !@execute.nil? end + # TODO uncomment in 6.0 + # def to_yaml + # private_execute.to_a.to_yaml + # end + private def private_execute diff --git a/test/relation_test.rb b/test/relation_test.rb index 9972c27..246d2af 100644 --- a/test/relation_test.rb +++ b/test/relation_test.rb @@ -33,4 +33,10 @@ class RelationTest < Minitest::Test store_names ["Product A", "Product B"] assert_equal ["Product A", "Product B"], Product.search("product").pluck(:name).sort end + + # TODO uncomment in 6.0 + # def test_to_yaml + # store_names ["Product A", "Product B"] + # assert_equal Product.all.to_yaml, Product.search("product").to_yaml + # end end -- libgit2 0.21.0