You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# frozen_string_literal: truerequire"bundler/inline"gemfile(true)dosource"https://rubygems.org"git_source(:github){ |repo| "https://github.com/#{repo}.git"}# Activate the gem you are reporting the issue against.gem"activerecord","~> 7.0.0"gem"sqlite3"endrequire"active_record"require"minitest/autorun"require"logger"# This connection will do for database-independent bug reports.ActiveRecord::Base.establish_connection(adapter: "sqlite3",database: ":memory:")ActiveRecord::Base.logger=Logger.new(STDOUT)ActiveRecord::Schema.definedocreate_table:posts,force: truedo |t|
endendclassPost < ActiveRecord::BaseendclassBugTest < Minitest::Testdeftest_association_stuffPost.create!(id: 1)Post.create!(id: 2)Post.create!(id: 3)assert_equal3,Post.where(id: 1..2).unscope(where: :id).count# double dot is workingassert_equal3,Post.where(id: 1...2).unscope(where: :id).count# triple dot is not workingendend
assert_equal 3, Post.where(id: 1..3).unscope(where: :id).count # double dot will work now
assert_equal 3, Post.where(id: 1...4).unscope(where: :id).count # triple dot will work now
end
Steps to reproduce
where
by triple dot rangeExpected behavior
Post.where(id: 1...2).unscope(where: :id)
returns3
Actual behavior
Post.where(id: 1...2).unscope(where: :id)
returns1
System configuration
Rails version: 7.0.4.3
Ruby version: 3.2.2
The text was updated successfully, but these errors were encountered: