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

Support rails 6.1, ruby 2.7, ruby 3.0 #77

Closed

Conversation

rewritten
Copy link
Contributor

@rewritten rewritten commented Nov 23, 2021

Better implementation of #76, that solves #75.

  • Several methods that assumed errors is a mutable array now fork behavior depending on the ActiveModel version.
  • Explicitly use kwargs splat in method_missing in Scopes
  • Wrap scope again when ruby 3.0 unwraps it (by calling array methods for instance)

References:

https://rubyreferences.github.io/rubychanges/3.0.html#array-always-returning-array

On custom classes inherited from Array, some methods previously were returning an instance of this class, and others returned Array. Now they all do the latter.

https://rubyreferences.github.io/rubychanges/2.7.html#keyword-argument-related-changes

Empty hash splat doesn’t pass empty hash as a positional argument.

https://github.com/rails/rails/blob/6-1-stable/activemodel/CHANGELOG.md

The ActiveModel’s errors collection is now an array of these Error objects, instead of messages/details hash.

@rewritten rewritten force-pushed the support-active-model-6-1-errors branch from c415b9b to 01870d1 Compare November 23, 2021 17:00
@@ -1,4 +1,4 @@
%w[4.2 5.1 5.2 6.0].each do |version|
%w[4.2 5.1 5.2 6.0 6.1].each do |version|
Copy link
Owner

Choose a reason for hiding this comment

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

it looks like you haven't run appraisals generate. Can you please add all the version defined here to the CI and regenerate all the gemfiles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about the meaning of the question. The gemfile for 6.1.0 is in the expected folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see what you mean @pyromaniac. Git is wrongly assuming there is a rename+change from the 4.2 gemfile to the 6.1 gemfile. But it really is a completely new file, the gemfiles for 4.2 to 5.2 were removed to be able to merge into toptal/active_data fork that relies on a different CI. I'll restore the previous changes so it will be clearer.

@rewritten rewritten force-pushed the support-active-model-6-1-errors branch from 792e242 to 01870d1 Compare December 14, 2021 08:15
@pyromaniac
Copy link
Owner

pyromaniac commented Dec 14, 2021

Hm, CI doesn't run. Can you make it work or tell me if you run all the rails versions locally? I think GH actions would be just fine. I can do it as well over the weekend.

@ojab
Copy link
Contributor

ojab commented Dec 14, 2021

https://app.travis-ci.com/github/pyromaniac/active_data

We are unable to start your build at this time. You exceeded the number of users allowed for your plan. Please review your plan details and follow the steps to resolution.

That's awesome, looks like travis wants everyone to migrate to GHA for real.
#78

@pyromaniac
Copy link
Owner

So if you rebase, I'll manage to merge it right away I believe.

@ojab ojab mentioned this pull request Dec 16, 2021
@rewritten
Copy link
Contributor Author

So this can be closed already, right?

@ojab
Copy link
Contributor

ojab commented Jan 8, 2022

Yep, I included it into #80 with minor fixes.

@rewritten rewritten closed this Jan 9, 2022
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.

3 participants