Skip to content

Commit

Permalink
Don't mutate row arrays that come back from the database adapter
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tenderlove committed Jan 24, 2024
1 parent bb0e59b commit 84130af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions activerecord/test/cases/finder_test.rb
Expand Up @@ -1614,9 +1614,9 @@ def test_select_rows
[["1", "1", nil, "37signals"],
["2", "1", "2", "Summit"],
["3", "1", "1", "Microsoft"]],
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? } })
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? } })
assert_equal [["1", "37signals"], ["2", "Summit"], ["3", "Microsoft"]],
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? } }
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? } }
end

def test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct
Expand Down

0 comments on commit 84130af

Please sign in to comment.