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:
parent
eabf569d3e
commit
0e35e670b2
@ -9,10 +9,6 @@ class PredicateBuilder # :nodoc:
|
||||
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 = []
|
||||
|
@ -424,14 +424,6 @@ def test_skip_preloading_after_arel_has_been_generated
|
||||
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
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user