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

Make dependency on Rails > 6.1 explicit #177

Merged
merged 1 commit into from Sep 6, 2021

Conversation

waiting-for-dev
Copy link
Contributor

There's at least one part of the extension that is not compatible with
Rails < 6.1. The ActiveModel::Errors handling maps the error
collection assuming that what is yielded is an instance of
ActiveModel::Error (call to error.attribute):

https://github.com/solidusio-contrib/solidus_graphql_api/blob/9629e8d6b5ee5767265c3e1068a13b2677430a98/lib/solidus_graphql_api/mutations/base_mutation.rb#L36-L41

However, the ActiveModel::Error object is only available from Rails
6.1
, and before that it was yielded the error key and message.

We also bump the minimal requirement for Solidus to 2.10, as it's the
first version that supported Rails 6.1 (last 2.9
version didn't support it
).

waiting-for-dev added a commit to solidusio/solidus-demo that referenced this pull request Aug 30, 2021
Besides keeping the stack up to date, this is needed for the graphql
extension to work without errors.

See solidusio/solidus_graphql_api#177
@kennyadsl
Copy link
Member

@waiting-for-dev Hey Marc, can you take a look at linting here?

There's at least one part of the extension that is not compatible with
Rails < 6.1. The `ActiveModel::Errors` handling maps the error
collection assuming that what is yielded is an instance of
`ActiveModel::Error` (call to `error.attribute`):

https://github.com/solidusio-contrib/solidus_graphql_api/blob/9629e8d6b5ee5767265c3e1068a13b2677430a98/lib/solidus_graphql_api/mutations/base_mutation.rb#L36-L41

However, the [`ActiveModel::Error` object is only available from Rails
6.1](https://guides.rubyonrails.org/6_1_release_notes.html#active-model-notable-changes),
and before that [it was yielded the error key and
message](https://api.rubyonrails.org/v6.0.0/classes/ActiveModel/Errors.html#method-i-each).

We also bump the minimal requirement for Solidus to 2.10, as it's the
first version that [supported Rails
6.1](https://rubygems.org/gems/solidus_core/versions/2.10.0) (last [2.9
version didn't support
it](https://rubygems.org/gems/solidus_core/versions/2.9.6)).
@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/explicit_rails_6_1_dependency branch from 57ce67e to 48724a3 Compare September 6, 2021 09:34
@waiting-for-dev
Copy link
Contributor Author

@waiting-for-dev Hey Marc, can you take a look at linting here?

Done!

@kennyadsl kennyadsl merged commit a8bb333 into master Sep 6, 2021
@kennyadsl kennyadsl deleted the waiting-for-dev/explicit_rails_6_1_dependency branch September 6, 2021 09:47
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.

None yet

2 participants