Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Rails 5.2 support #67
Rails 5.2 support #67
Changes from all commits
b0db5ff
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thinks it would be a good idea to use Rails previous_changes here.
previous_changes
exists from Rails 3.0 and it works on the latest Rails 6(master) also.previous_changes_include?
is dropped in Rails 5.2.3Something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method https://github.com/rails/rails/blob/6-0-stable/activemodel/lib/active_model/dirty.rb#L227 based on
changes
, butchanges
didn't work for attributes like this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They behave differently,
changes
returns hash of changes before save,previous_changes
after it's saved.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just pull this PR and test it against rails master. With
previous_changes_include?
(dropped method) it doesn't work, withprevious_changes
works as expectedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not my pull request, I have other one:
https://github.com/hashicorp/vault-rails/pull/76/files
I try show previous_changes here https://github.com/hashicorp/vault-rails/pull/76/files#diff-ba19de511d4dbf96b22d51bf1ecbf448R268 and it was empty when changed_attributes present.
May be it specific only for my PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dixpac thanks for the suggestion, and you're right, if I make that change and get the latest Rails 6 RC into the Appraisals file, the test suite is green.
@justincampbell did you want the Rails 6 fix added to this PR? Or would you prefer to merge what's here in first, and then I can create a smaller one for just Rails 6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @pat and @justincampbell we are using this branch since September and would like to know if there is a todolist of outstanding items for the merge, now we already need support for Rails 6 as well.
We can work on this pull request if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! I'm interested in using this in production as well, but also would need this merged to master. Can I help at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @pat Is there any work left to proceed with the merge ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mod if you're finding it works for you, then I think it's ready? I'm not an owner of the repo, I can't merge things.
And also: the organisation I worked for when creating this PR no longer exists, and so I'm no longer using this gem – so your experience with it is going to be far more valid and recent than mine.