We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
begin require "bundler/inline" rescue LoadError => e $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" raise e end gemfile(true) do source "https://rubygems.org" gem "activerecord", '~> 6.0.3' gem "sqlite3" end require "active_record" require "minitest/autorun" require "logger" ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") ActiveRecord::Base.logger = Logger.new(STDOUT) ActiveRecord::Schema.define do create_table "users", force: :cascade do |t| end end class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end class User < ApplicationRecord end User.transaction do 3.times do User.create end end class BugTest < Minitest::Test def test_update_all assert_equal 3, User.update_all('id = id') end def test_update_all_in_batches assert_equal 3, User.in_batches.update_all('id = id') end end =begin Result: 1) Failure: BugTest#test_update_all_in_batches [test.rb:45]: Expected: 3 Actual: nil =end
Expect the update_all method always returns the number of rows affected.
update_all
The return value of in_batches.update_all is nil.
in_batches.update_all
Rails version: Rails 6.0.3.2
Ruby version: ruby 2.6.4p104 (2019-08-28 revision 67798) [x86_64-linux]
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Steps to reproduce
Expected behavior
Expect the
update_all
method always returns the number of rows affected.Actual behavior
The return value of
in_batches.update_all
is nil.System configuration
Rails version:
Rails 6.0.3.2
Ruby version:
ruby 2.6.4p104 (2019-08-28 revision 67798) [x86_64-linux]
The text was updated successfully, but these errors were encountered: