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

Save pre-saved changed_attributes. #339

Closed
wants to merge 2 commits into from
Closed

Save pre-saved changed_attributes. #339

wants to merge 2 commits into from

Conversation

treby
Copy link
Contributor

@treby treby commented Mar 3, 2015

Hi!

I use update_document method in after_commit for transaction. In a controller, if we call save method twice or more times in transaction block, before_save overwrites @__changed_attributes variable. So elasticsearch does not reflect entire changes.

So I tried to keep the variable before overwrite.

@karmi
Copy link
Contributor

karmi commented Apr 8, 2015

Hi, thanks for the catch! Can we add a test for this? I think an integration test is fine in this case.

@karmi karmi added the waiting label Apr 8, 2015
@treby
Copy link
Contributor Author

treby commented Apr 10, 2015

Thank you for your response! I will write test for this change.

@treby
Copy link
Contributor Author

treby commented Apr 18, 2015

@karmi I wrote a test. Please review. Tell me anything if you have any problems or advices!

@karmi karmi closed this in ee0af92 Apr 22, 2015
@karmi
Copy link
Contributor

karmi commented Apr 22, 2015

Thanks, @treby, merged!

@treby
Copy link
Contributor Author

treby commented Apr 23, 2015

Thanks!

@treby treby deleted the save_pre_saved_changed_attributes branch April 29, 2015 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants