Skip to content

Commit 84130af

Browse files
committed
Don't mutate row arrays that come back from the database adapter
In SQLite3-Ruby version 2.0, I would like to make row arrays frozen. I tested the change, and it only breaks this test, so I'm changing the test. I don't think we should be mutating the objects that the database adapter returns
1 parent bb0e59b commit 84130af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/test/cases/finder_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,9 +1614,9 @@ def test_select_rows
16141614
[["1", "1", nil, "37signals"],
16151615
["2", "1", "2", "Summit"],
16161616
["3", "1", "1", "Microsoft"]],
1617-
Company.connection.select_rows("SELECT id, firm_id, client_of, name FROM companies WHERE id IN (1,2,3) ORDER BY id").map! { |i| i.map! { |j| j.to_s unless j.nil? } })
1617+
Company.connection.select_rows("SELECT id, firm_id, client_of, name FROM companies WHERE id IN (1,2,3) ORDER BY id").map { |i| i.map { |j| j.to_s unless j.nil? } })
16181618
assert_equal [["1", "37signals"], ["2", "Summit"], ["3", "Microsoft"]],
1619-
Company.connection.select_rows("SELECT id, name FROM companies WHERE id IN (1,2,3) ORDER BY id").map! { |i| i.map! { |j| j.to_s unless j.nil? } }
1619+
Company.connection.select_rows("SELECT id, name FROM companies WHERE id IN (1,2,3) ORDER BY id").map { |i| i.map { |j| j.to_s unless j.nil? } }
16201620
end
16211621

16221622
def test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct

0 commit comments

Comments
 (0)