We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5731d25 commit 8e7d2a8Copy full SHA for 8e7d2a8
lib/searchkick/relation.rb
@@ -695,6 +695,7 @@ def ensure_permitted(obj)
695
696
def initialize_copy(other)
697
super
698
+ @options = @options.deep_dup
699
@execute = nil
700
end
701
test/relation_test.rb
@@ -23,6 +23,13 @@ def test_mutating
23
assert_equal ["Product A"], products.map(&:name)
24
25
26
+ def test_non_mutating
27
+ store_names ["Product A", "Product B"]
28
+ products = Product.search("*").order(:name)
29
+ products.limit(1)
30
+ assert_equal ["Product A", "Product B"], products.map(&:name)
31
+ end
32
+
33
def test_load
34
products = Product.search("*")
35
refute products.loaded?
0 commit comments