heartcombo / devise

Flexible authentication solution for Rails with Warden.
http://blog.plataformatec.com.br/tag/devise/
MIT License
23.85k stars 5.53k forks source link

Avoid using `with_options` for Rails 7.1.0 support #5638

Closed r7kamura closed 9 months ago

r7kamura commented 9 months ago

I encountered the problem reported in the following Issue:

As gagoit mentioned in the comments of that issue, I think the problem is caused by a change in the behavior of Hash#deep_merge used inside Object#with_options in Rails 7.1.0.

Simply avoiding the use of Object#with_options looks a good way to solve the problem, so I suggest changing it that way to support Rails 7.1.0.

I tried this change on a medium sized app that I am upgrading to Rails 7.1.0 and found it to work fine.

carlosantoniodasilva commented 9 months ago

@r7kamura thanks for the updates. It looks like the culprit might be something else (potentially the config gem?), see the conversation there. Can you double check if that's the case for you as well?

If there's such a fundamental behavior change in with_options / deep_merge, I'd rather not change Devise to accommodate it but try to look for the potential underlying problem. If there's no other way around it, fine, but otherwise that seems the best option.