Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rails 6.1 support #3862

Merged

Conversation

filippoliverani
Copy link
Contributor

@filippoliverani filippoliverani commented Dec 11, 2020

Description
Fixes #3784

This PR fixes some incompatibilities with Rails 6.1:

  • default values of ActiveRecord serialized hash attributes have changed
  • the current version of rspec-activemodel-mockss mock_model is not compatible with some ActiveRecord associations
  • current controller is not available anymore in helpers specs
  • select in joins now always works correctly
  • ActionController's error messages now provide DidYouMean suggestions

TODO:

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • [ ] I have updated Guides and README accordingly to this change (if needed)
  • [ ] I have added tests to cover this change (if needed)
  • [ ] I have attached screenshots to this PR for visual changes (if needed)

@kennyadsl
Copy link
Member

@filippoliverani they both seem merged now. I'd wait for #3865 to be merged since at the moment that's the only way to have the CanonicalRails gem working with Rails 6.1.

@peterberkenbosch
Copy link
Contributor

Looking good!!

@filippoliverani filippoliverani force-pushed the filippoliverani/rails-master-support branch 2 times, most recently from 820f64f to 3f5e638 Compare December 18, 2020 11:49
Since rails/rails@7b39197 serialezable hash attributes are not allocated
by default anymore if not used.
Since rails/rails@c53c4 rspec-activemodel-mocks is not compatible
anymore with `ActiveRecord#has_attribute` inner implemementation,
to work around that we can replace mocks with stubs where
possibile.
Since rails/rails@65e42c9 `ActionController::Base#controller_name` is
empty in test enviroment and must be explicitly subbed in Rspec.
Since rails/rails@4639318 `select` on joined tables has started to work
correctly instead of returing all fields.
Since rails/rails@5411565 DidYouMean suggestions has been added to
missing params errors in controllers, we have to remove them before
using error messages in API error responses body.
@filippoliverani filippoliverani force-pushed the filippoliverani/rails-master-support branch from 3f5e638 to 1bdd18c Compare December 21, 2020 09:38
@filippoliverani filippoliverani force-pushed the filippoliverani/rails-master-support branch from 1bdd18c to 8fb31ac Compare January 7, 2021 11:00
@filippoliverani filippoliverani marked this pull request as ready for review January 7, 2021 11:00
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@peterberkenbosch
Copy link
Contributor

Awesome work! 👍

@kennyadsl kennyadsl merged commit aadc783 into solidusio:master Jan 8, 2021
@kennyadsl kennyadsl deleted the filippoliverani/rails-master-support branch January 8, 2021 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rails 6.1 compatibility
4 participants