Skip to content

Commit

Permalink
test from nil in rails 7.07
Browse files Browse the repository at this point in the history
  • Loading branch information
khiav223577 committed Sep 4, 2023
1 parent 99cc69d commit cf84bb1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/update_all_and_get_ids_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,15 @@ def test_on_relation_and_with_race_condition
assert_equal ['bomb', '', 'flame thrower'], Item.order('id').pluck(:name)
end
end

def test_select_from_dual
skip if not Atomically::AdapterCheckService.new(UserItem).mysql?

in_sandbox do
assert_sqls(['SELECT @ids FROM DUAL']) do
assert_equal [1, 2], Item.joins(:users).atomically.update_all_and_get_ids('items.name = ""')
assert_equal ['', '', 'flame thrower'], Item.order('id').pluck(:name)
end
end
end
end

0 comments on commit cf84bb1

Please sign in to comment.