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

as_indexed_json not being called on save #59

Closed
jakcharlton opened this issue Mar 26, 2014 · 2 comments
Closed

as_indexed_json not being called on save #59

jakcharlton opened this issue Mar 26, 2014 · 2 comments
Labels

Comments

@jakcharlton
Copy link

No matter what settings I seem to use, the as_indexed_json method is only called when I do Model.import, but not on save

AM I missing something obvious in the documentation?

@karmi
Copy link
Contributor

karmi commented Mar 28, 2014

What kind of settings and what exactly are you doing? Have you checked the examples in elasticsearch-model and the Rails application templates in elasticsearch-rails?

@karmi karmi added the waiting label Mar 28, 2014
karmi added a commit that referenced this issue Apr 15, 2014
…serialized during update

Previously, the `update_document` method simply intercepted the changes to the model, via the
`@__changed_attributes` variable, and used these directly.

This caused models with a custom serialization method to be incorrectly serialized, namely
unwanted attributes were added.

This patch looks for `as_indexed_json` defined on the model, and when it finds it,
filters the changed attributes through the keys.

Closes #75

Related:

* #59
* #57
* #52
* #40
* #37
* #5
@karmi
Copy link
Contributor

karmi commented Apr 15, 2014

Hi, closing this, if you wanna discuss it more, please reopen or ping me.

@karmi karmi closed this as completed Apr 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants