Remove no-op `PredicateBuilder::BaseHandler` constant

That is to prevent the "uninitialized constant" error when loading the
data marshalized by the previous version of Rails (Rails 6.0), it is not
needed for the future version of Rails.

See #39611.

I've added the no-op constant in that time, but we usually don't
guarantee the marshalized object compatibility.

This also avoids the "instance variable @future_result not initialized"
warning in the `test_marshal_load_legacy_relation`.

https://buildkite.com/rails/rails/builds/75166#3d7e57df-3679-4fa8-9f17-e1b0533c3ccf/1074-1081
This commit is contained in:
Ryuta Kamizono 2021-02-18 16:04:27 +09:00
parent eabf569d3e
commit 0e35e670b2
3 changed files with 0 additions and 12 deletions

View File

@ -9,10 +9,6 @@ module ActiveRecord
require "active_record/relation/predicate_builder/association_query_value"
require "active_record/relation/predicate_builder/polymorphic_array_value"
# No-op BaseHandler to work Mashal.load(File.read("legacy_relation.dump")).
# TODO: Remove the constant alias once Rails 6.1 has released.
BaseHandler = BasicObjectHandler
def initialize(table)
@table = table
@handlers = []

View File

@ -424,14 +424,6 @@ module ActiveRecord
end
end
def test_marshal_load_legacy_relation
path = File.expand_path(
"support/marshal_compatibility_fixtures/legacy_relation.dump",
TEST_ROOT
)
assert_equal 11, Marshal.load(File.read(path)).size
end
test "no queries on empty IN" do
assert_queries(0) do
Post.where(id: []).load