File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 6.0.3 (unreleased)
2+
3+ - Improved ` to_json ` method for ` Relation `
4+
15## 6.0.2 (2025-10-24)
26
37- Fixed ` as_json ` method for ` HashWrapper `
Original file line number Diff line number Diff line change @@ -644,6 +644,10 @@ def respond_to_missing?(...)
644644 Results . new ( nil , nil , nil ) . respond_to? ( ...) || super
645645 end
646646
647+ def to_json ( ...)
648+ private_execute . to_a . to_json ( ...)
649+ end
650+
647651 def to_yaml
648652 private_execute . to_a . to_yaml
649653 end
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def test_default
1818 assert_equal "Product A" , product . attributes [ "name" ]
1919 assert_equal "Product A" , product . as_json [ "name" ]
2020 assert_equal "Product A" , JSON . parse ( product . to_json ) [ "name" ]
21- assert_equal "Product A" , JSON . parse ( Product . search ( "product" ) . to_a . to_json ) . first [ "name" ]
21+ assert_equal "Product A" , JSON . parse ( Product . search ( "product" ) . to_json ) . first [ "name" ]
2222 end
2323
2424 def test_false
@@ -34,7 +34,7 @@ def test_false
3434 assert_equal "Product A" , product . to_h [ "name" ]
3535 assert_equal "Product A" , product . as_json [ "name" ]
3636 assert_equal "Product A" , JSON . parse ( product . to_json ) [ "name" ]
37- assert_equal "Product A" , JSON . parse ( Product . search ( "product" , load : false ) . to_a . to_json ) . first [ "name" ]
37+ assert_equal "Product A" , JSON . parse ( Product . search ( "product" , load : false ) . to_json ) . first [ "name" ]
3838 end
3939
4040 def test_false_methods
You can’t perform that action at this time.
0 commit comments