Skip to content

Commit 1626bce

Browse files
authored
Fix Relation#inspect failing due to private Results#results (#1733)
In v6.0, Results#results was made private, breaking Relation#inspect which relied on delegating the `results` call through delegate_missing_to. Since delegate_missing_to uses public_send, it cannot access private methods. Fix by calling private_execute.first(11) directly instead of results.first(11).
1 parent 107d270 commit 1626bce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/searchkick/relation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def initialize(model, term = "*", **options)
2222

2323
# same as Active Record
2424
def inspect
25-
entries = results.first(11).map!(&:inspect)
25+
entries = private_execute.first(11).map!(&:inspect)
2626
entries[10] = "..." if entries.size == 11
2727
"#<#{self.class.name} [#{entries.join(', ')}]>"
2828
end

0 commit comments

Comments
 (0)