devise
devise copied to clipboard
turbo_stream fix bugs for rails 7 and above apps
I tried to fix this two issues: https://github.com/heartcombo/devise/issues/5448, https://github.com/heartcombo/devise/issues/5446.
@carlosantoniodasilva Would be great to get this or something similar merged
PR #5340 looks like it aims for a deeper integration into devise than what is proposed in this pull request.
Besides this, using turbo is also valid in a rails 6.1 context. So just checking for "> Rails 7" would exclude some valid use cases
@tmaier Would something along the lines of a class_option
boolean on the generator allow for less surprising behavior than checking for a Rails version?
class_option :turbo, type: :boolean, default: false
That way somebody who wants Turbo could run rails generate devise:install --turbo
to get Turbo behavior generated irrespective of Rails version.
You could make the default true
for 5.x, but keep behavior as-is unless somebody specifically requests generation with Turbo in 4.x.
I am not sure what's the right approach in the context of devise.
I think I would have checked, if Turbo
is defined with defined?(::Turbo)
Ref. https://github.com/hotwired/turbo-rails/blob/main/lib/turbo-rails.rb
PR #5340 looks like it aims for a deeper integration into devise than what is proposed in this pull request.
Besides this, using turbo is also valid in a rails 6.1 context. So just checking for "> Rails 7" would exclude some valid use cases
Perhaps Devise should just be versioned with incremental support for Rails 6 dropped, in favor of a cleaner implementation for Rails 7+?
Forgive me for chiming in on this, but I am getting confused by the different issues.
Is there a canonical (at at least blessed) way to get Devise and Rails 7 playing nicely together?
The main branch should contain all that's necessary for fully working with Turbo now, based on the changes here and a few others. A new version will be released soon, but feel free to test it out from the main branch in the meantime, and report back on any issues. Thanks.