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

Conversation

Projects
None yet
2 participants
@treby
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 10, 2015

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

@treby

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

commented Apr 22, 2015

Thanks, @treby, merged!

@treby

This comment has been minimized.

Copy link
Contributor Author

commented Apr 23, 2015

Thanks!

@treby treby deleted the treby:save_pre_saved_changed_attributes branch Apr 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.