Deprecate Class handler in PredicateBuilder#17916
Conversation
|
Could you add a CHANGELOG entry? |
|
Sure thing. |
Users should pass strings to queries instead of classes
0c1e0dd to
c0609dd
Compare
|
Added a CHANGELOG entry. |
Deprecate `Class` handler in `PredicateBuilder`
|
Passing a class for the type column of a polymorphic relationship or an STI table makes perfect sense to me. Of course you can work around it by defining a visitor in Arel, but that's not readily accessible for most users. So I think the use case in the test should be fixed, but not the concept as such. |
|
Why is passing |
|
For a namespaced class |
I'd say usage. Symbol and Active Record instance are more used. |
Fixed Deprecation Warning :: Passing a class as a value in an Active Record query is deprecated and will be removed. Pass a string instead. Refer rails/rails#17916 Used Rspec stub_const to silence CONSTANT redefinition warnings Pending: Failing Specs for acts_as_multilist concern TRACE_START Spree::Marketing::List::MostZoneWiseOrders behaves like acts_as_multilist .generator if list doesn't exists should change result by 1 Failure/Error: it { expect { list_type.send :generator }.to change { list_type.all.count }.by 1 } expected result to have changed by 1, but was changed by 0 Shared Example Group: "acts_as_multilist" called from ./spec/models/spree/marketing/list/most_zone_wise_orders_list_spec.rb:12 # ./spec/shared/acts_as_multilist.rb:59:in `block (4 levels) in <top (required)>' TRACE_END
Users should pass strings to queries instead of classes