Closed p8 closed 3 years ago
@p8 thanks for this; I take it that being marked as draft means it's not ready?
@parndt Yes, I'm not sure this is the correct implementation. I'll create an issue in Rails to make sure.
@parndt Please merge it。
@parndt Please merge it。
@clwy-cn no, thanks... I'm waiting for @p8 to confirm, as it's their PR.
I've created an issue in Rails: https://github.com/rails/rails/issues/41066
@parndt I've made some changes as suggested by the @kamipo, the author of the deprecation warning: https://github.com/rails/rails/issues/41066#issuecomment-757374841
Thanks @parndt !
@marcrohloff as the author of the original change, I thought you probably wanted to know about these changes.
@parndt Has the problem been solved? Please push to rubygems.org
@clwy-cn to clarify, are you asking about the Rails 4.0 regression mentioned in #443, or are you asking about this work on the master branch being pushed as 4.0.0 ?
@parndt thanks for reply, I am asking about this work.
This is because the version 3.31 , scoped
is not working properly,I am using this gem by
gem 'awesome_nested_set', git: 'https://github.com/collectiveidea/awesome_nested_set'
right now.
@clwy-cn what is your Rails version?
@parndt
ruby 3.0.0
can you find out for me whether it works on Ruby 2.7.2?
6c5040c4c116cbff2bea69724972cff500f8334f Fixed the Rails 6.1 deprecation warnings for inherited scoping by making scopes explicit using
Model.unscoped
, orModel.default_scoped
.However the
default_scoped
method added toModel.nested_set_scope
broke callingroots
onRelatable
when the nested set is scoped:Instead of using two separate class methods,
nested_set_scope_without_default_scope
andnested_set_scope
, that apply the scope, we move thedefault_scoped
andunscoped
calls toself.class.base_class
. This fixes theroots
scope and removes the deprecation warnings.Also see the Rails discussion: https://github.com/rails/rails/issues/41066#issuecomment-757374841
Fixes: #436