3948 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
31c4f31ef4 Tweak comment about overriding Devise.responder
Albeit it's not super recommended, it's possible and even mentioned in
the changelog/wiki in case the app has some additional responder logic
that needs to be applied to Devise across the board.
2023-02-09 08:51:42 -03:00
Carlos Antonio da Silva
8606e1e671 Expand changelog/readme with info about Turbo vs rails-ujs behavior
Explain a bit more about how `data-confirm` and `data-method` need to be
updated to the turbo versions `data-turbo-confirm` and
`data-turbo-method`, respectively. (and depending on its usage.)

[ci skip]
2023-02-07 11:05:53 -03:00
Carlos Antonio da Silva
2df5efcece Add post install message pointing to the changelog and new upgrade guide
There's some additional information in the wiki upgrade guide for those
interested, but most of it is covered in the changelog and should
suffice.

The post install message should help guide people upgrading to make sure
they know what to do in this new version, since some may be using Turbo
out there with custom responders and failure apps and those would have
to be removed in order to use these new changes fully. Hopefully that's
enough of a nudge for them.
2023-02-03 15:41:30 -03:00
Carlos Antonio da Silva
43c349a2fc Point version to v4.9.0.alpha for now
Just want to have something different than the currently released
version to test out more easily. Plus, this is probably going to become
v4.9.0 final soon anyway.
2023-02-03 15:26:24 -03:00
Carlos Antonio da Silva
0d392fa49f Use the released version of responders v3.1.0
Unfortunately we can't enforce the version in the gemspec because
responders only supports Rails 5.2 now, and Devise still supports
previous versions.

We'll drop support for those in a future major release, so for now I'm
not adding any version.

This also adds a warning in case someone is using an older version of
responders and tries to set the error/redirect statuses via Devise, so
that they know what to do (upgrade responders) in that case.
2023-02-03 14:09:42 -03:00
Carlos Antonio da Silva
d0f0853c75 Remove CodeClimate badge
It's not working right now, and we haven't used it in like forever
to drive anything.

Closes #5549

[ci skip]
2023-02-03 11:50:42 -03:00
Carlos Antonio da Silva
88625d488f Use button_to to generate a POST form, disable turbo with OmniAuth
This changes the OmniAuth "sign in" links to use buttons, which can be
wrapped in an actual HTML form with a method POST, making them work
better with and without Turbo in the app. It doesn't require rails/ujs
anymore in case of a non-Turbo app, as it previously did with links +
method=POST.

Turbo is disabled for those OmniAuth buttons, as they simply don't work
trying to follow the redirect to the OmniAuth provider via fetch,
causing CORS issues/errors.
2023-02-01 11:29:17 -03:00
Carlos Antonio da Silva
f08e0ad24a Integrate with Hotwire/Turbo by configuring error and response statuses
Treat `:turbo_stream` request format as a navigational format, much like
HTML, so Devise/responders can work properly.

Allow configuring the `error_status` and `redirect_status` using the
latest responders features, via a new custom Devise responder, so we can
customize the both responses to match Hotwire/Turbo behavior, for
example with `422 Unprocessable Entity` and `303 See Other`,
respectively. The defaults aren't changing in Devise itself (yet), so it
still responds on errors cases with `200 OK`, and redirects on non-GET
requests with `302 Found`, but new apps are generated with the new
statuses and existing apps can opt-in. Please note that these defaults
might change in a future release of Devise.

PRs/Issues references:

https://github.com/heartcombo/devise/pull/5545
https://github.com/heartcombo/devise/pull/5529
https://github.com/heartcombo/devise/pull/5516
https://github.com/heartcombo/devise/pull/5499
https://github.com/heartcombo/devise/pull/5487
https://github.com/heartcombo/devise/pull/5467
https://github.com/heartcombo/devise/pull/5440
https://github.com/heartcombo/devise/pull/5410
https://github.com/heartcombo/devise/pull/5340

https://github.com/heartcombo/devise/issues/5542
https://github.com/heartcombo/devise/issues/5530
https://github.com/heartcombo/devise/issues/5519
https://github.com/heartcombo/devise/issues/5513
https://github.com/heartcombo/devise/issues/5478
https://github.com/heartcombo/devise/issues/5468
https://github.com/heartcombo/devise/issues/5463
https://github.com/heartcombo/devise/issues/5458
https://github.com/heartcombo/devise/issues/5448
https://github.com/heartcombo/devise/issues/5446
https://github.com/heartcombo/devise/issues/5439
2023-01-31 11:02:01 -03:00
Carlos Antonio da Silva
3632ddf674 Remove XML serializer from a couple gemfiles missed previously
It looks like I missed removing it when XMl was replaced with JSON
across our test suite in a793472a3e.
2023-01-31 10:12:24 -03:00
Carlos Antonio da Silva
cddba28945 Bundle update 2023-01-27 17:15:20 -03:00
Carlos Antonio da Silva
032c4476ae Merge branch 'ca-build' 2023-01-19 11:44:25 -03:00
Carlos Antonio da Silva
319d9fa648 Run with the latest rubygems on newer Ruby versions
Rails master on Ruby 2.7/3.0 is failing with the following error:

    Resolving dependencies...
    Could not find compatible versions
    Because every version of rails depends on RubyGems >= 3.3.13
      and Gemfile-rails-main depends on rails >= 0,
      RubyGems >= 3.3.13 is required.
    So, because current RubyGems version is = 3.1.6,
      version solving has failed.

Trying to run with the latest available rubygems to see if that can fix
the problem, but sticking to the "default" rubygems version on older
Ruby versions to avoid build issues there.
2023-01-19 09:58:53 -03:00
Carlos Antonio da Silva
59bedaa1e7 Attempt to get the build running on Ruby 2.2
It appears we're getting a newer version of this multipart-post
dependency, which doesn't work well with Ruby 2.2 by using
`Object.deprecate_constant`, resulting in the following error:

    .../multipart-post-2.2.0/lib/multipart/post/parts.rb:152:in `<top (required)>':
    undefined method `deprecate_constant' for Object:Class (NoMethodError)

Hopefully by locking on a previous version we can just get the build
back to green for now.
2023-01-17 14:47:26 -03:00
Carlos Antonio da Silva
fc1ac76ddf Add support to Ruby 3.2 (no changes needed) 2023-01-17 14:29:38 -03:00
okyanusoz
41003bf5de Update new.html.erb 2022-08-30 17:06:16 +03:00
Carlos Antonio da Silva
6d32d2447c Merge pull request #5503 from ak15/main
Fix typo in lockable documentation
2022-06-27 10:37:35 -03:00
Atul Kanswal
d4bf52bdfd Update lockable.rb
Documentation Confusion
2022-06-27 16:28:03 +05:30
Carlos Antonio da Silva
f8d1ea90bc Merge pull request #5484 from heartcombo/ca-build
Fix build
2022-04-22 13:29:19 -03:00
Carlos Antonio da Silva
2fa9303ab3 Use new method to reset CSRF exposed via the request object
This simplifies the logic considerably, as we don't need to reach out to
what seems more internal-ish implementation of Rails with the
interaction between the request and controller objects.

b925880914
2022-04-22 12:56:10 -03:00
Carlos Antonio da Silva
b5172a0cdb Fix csrf cleanup for Rails 7.1 (main)
Rails implemented a CSRF token storage strategy to allow storing the
CSRF tokens outside of the sessios (for example, in an encrypted
cookie), and changed how the value is kept around during the request
cycle, by using a request.env value.

We still want to ensure the final session value is cleaned correctly in
the test, but the implementation needed to change since we can't simply
delete from the session anymore, we need to make sure we call the Rails
methods for resetting the current storage strategy so it works with all
of them.

https://github.com/rails/rails/pull/44283
2022-04-22 11:08:44 -03:00
Carlos Antonio da Silva
e1c53d6580 Check for empty response body on redirect with Rails main (future 7.1)
Rails is no longer returning a message with the response body on
redirects, just an empty body.

https://github.com/rails/rails/pull/44554
2022-04-22 09:30:58 -03:00
Carlos Antonio da Silva
875217d8c1 Only set property for Rails 7, it has been removed on master
https://github.com/rails/rails/pull/44827
2022-04-22 09:17:46 -03:00
Carlos Antonio da Silva
55eabee800 Use https source for github repos with Bundler 1.x
GitHub no longer supports the git:// protocol, which was the default in
Bundler 1.x.

From the build:

    The unauthenticated git protocol on port 9418 is no longer supported.
    Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/
    for more information.
2022-04-22 09:17:46 -03:00
Carlos Antonio da Silva
8d4c3647a7 Update bundle 2022-04-22 09:17:46 -03:00
Carlos Antonio da Silva
700284fc67 Merge pull request #5483 from yysaki/feature/main_branch_url
Update the urls which refer nonexistent master branch name in documentations
2022-04-21 15:22:11 -03:00
yysaki
1542b7da29 Update the urls which refer nonexistent master branch name in documentations 2022-04-21 23:29:30 +09:00
Glauco Custódio
a78948f53c Use bundle add instead
As per https://github.com/rubygems/rubygems/pull/5337, we can simplify the steps of adding a gem.
2022-03-21 12:10:43 +00:00
Carlos Antonio da Silva
451ff6d49c Reorganize test matrix & use latest bundler
* Rails and Ruby versions follow the most recent to oldest, except for
  Rails main, so we can keep the Gemfile the first one.
* Excluding specific matrix combinations based on the Gemfile first,
  Ruby version next, and keep the same order (most recent -> oldest)
* Quote all Ruby versions to keep things consistent. It's required for
  the '3.0' version to avoid the float issue where it'd use the latest
  3.x instead.
2022-02-25 14:50:01 -03:00
Carlos Antonio da Silva
542df3634b Merge pull request #5450 from petergoldstein/feature/add_ruby_3_1
Add Ruby 3.1 to CI matrix
2022-02-25 14:39:14 -03:00
Peter Goldstein
3c5acaf531 Add Ruby 3.1 to CI matrix. Lock to Nokogiri < 1.13 for webrat compatibility 2022-02-23 08:37:31 -08:00
Carlos Antonio da Silva
025b1c8734 Add date to v4.8.1 changelog [ci skip] 2021-12-16 08:08:57 -03:00
Carlos Antonio da Silva
43800b4b85 Bump to 4.8.1 with Rails 7 support
Also note in the Changelog that Turbo is not fully supported yet.
v4.8.1
2021-12-16 08:04:21 -03:00
Carlos Antonio da Silva
baf5e00544 Merge pull request #5435 from dixpac/dix/rails_7
Add support for Rails 7
2021-12-16 08:02:18 -03:00
Dino Maric
289dd5f221 Add support for Rails 7
This commit adds support for latest Rails release.
2021-12-16 10:12:05 +01:00
Carlos Antonio da Silva
9f5b83750e Bundle update to Rails 7.0 rc1 2021-12-08 08:26:05 -03:00
Derek Crosson
1ac16b15e3 Merge pull request #1 from DerekCrosson/DerekCrosson-fix-change-commands-copied-to-clipboard
chore: remove dollar symbol from some commands
2021-11-01 02:48:16 +02:00
Derek Crosson
353d86e01c chore: remove dollar symbol from some commands
When you copy the commands that have the terminal beginning of line symbol in front of them you now no longer need to first delete this before running the command
2021-11-01 02:44:35 +02:00
Carlos Antonio da Silva
8593801130 Keep the constantize behavior consistent for versions prior to Rails 7
Use `AS::Dependencies` as before if we still can, otherwise use the new
direct `constantize` call for Rails 7+.

Leave a TODO to help remind us this can be removed once we drop support
to Rails versions prior to 7 in the future.
2021-10-08 08:33:47 -03:00
Carlos Antonio da Silva
bb879f7154 Merge branch 'ca-rails-main'
Add Rails 7 / main support
2021-10-07 20:23:21 -03:00
Carlos Antonio da Silva
772b74a657 Update Changelog adding Rails 7 support 2021-10-07 20:15:44 -03:00
Carlos Antonio da Silva
51bf327017 Refactor using helper to swap config 2021-10-07 19:06:33 -03:00
Carlos Antonio da Silva
14eb1362e3 Eliminate Rails 7 warning about Active Record legacy connection handling
DEPRECATION WARNING: Using legacy connection handling is deprecated.
    Please set `legacy_connection_handling` to `false` in your application.
2021-10-07 18:46:40 -03:00
Carlos Antonio da Silva
f3e8fd3baa Move the Gemfile to test with Rails 7.0 alpha2, fix session test issue
It appears setting the `rack.session` to a simple hash doesn't work
anymore as it now has a few additional methods Rails is relying on to
determine whether it's enabled or not:
https://github.com/rails/rails/pull/42231

Failure:
    NoMethodError: undefined method `enabled?' for {}:Hash
    rails (f55cdafe4b82) actionpack/lib/action_dispatch/middleware/flash.rb:62:in `commit_flash'

Turns we we don't seem to need to set `rack.session` for the tests here.
2021-10-07 18:08:16 -03:00
strobilomyces
a0ccc1cf96 Fix deprecated ActiveSupport::Dependencies.constantize (#5397)
Changes deprecated `ActiveSupport::Dependencies.constantize(model_name)` to `model_name.constantize`

Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2021-10-07 17:27:37 -03:00
Alex Ghiculescu
b39faffde4 Test against Rails main and remove ActiveSupport::Dependencies.reference (#5357)
Remove `ActiveSupport::Dependencies.reference`

This was deleted from Rails: 14d4edd7c3

As far as I can tell, it was meant to add a performance boost at some point in the past but doesn't seem to do anything useful these days.
2021-10-07 17:18:37 -03:00
Carlos Antonio da Silva
366a428b2c Revise docs from #5405
Update a couple other modules that still referred to `devise_for` to
point to `devise`, and make all of them more consistent. We can only
mention `devise`, that should be clear enough about it being options
for the model method.
2021-10-06 19:20:07 -03:00
Carlos Antonio da Silva
7d103bc627 Merge pull request #5405 from chihaso/fix_comment_in_some_modules
Fix comment in some modules [ci skip]
2021-10-06 19:17:21 -03:00
chihaso
bdd2e7e24f Fix comment in some modules
- It says that the option is added to devise_for, but it is actually added to the devise method in the model.
2021-09-17 14:37:28 +09:00
Carlos Antonio da Silva
c82e4cf47b Merge pull request #5378 from nickhammond/patch-1
Add metadata for RubyGems
2021-05-08 10:19:35 -03:00
Nick Hammond
63ccdfb34a Add metadata for RubyGems 2021-05-06 16:33:39 -07:00