Skip to content

Commit

Permalink
add test case converting relation to_a does not raise an error (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
franlocus authored Mar 24, 2023
1 parent 8686f94 commit c010f1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/activerecord/safe_query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
it "does not raise an error when iterating over a relation with an in clause and a limit" do
expect { User.where(id: [1, 2, 3]).limit(1).each {} }.to_not raise_error
end

it "does not raise an error when iterating over a relation converted to an array" do
expect { User.all.to_a.each {} }.to_not raise_error
end
end

0 comments on commit c010f1b

Please sign in to comment.