Skip to content

Conversation

@dgmora
Copy link

@dgmora dgmora commented Jan 18, 2017

As pointed out in #450 and #289, the validation doesn't work when you make an update that makes a field invalid.

My knowledge in elasticsearch is very limited, so I am not sure if updating in line 115 works well with the attributes being passed directly in line 126. You might want to pass self.attributes to update instead.

@hfenton
Copy link

hfenton commented Oct 11, 2017

Any priority on getting this to pass CI and merged? IMO, this is a huge flaw in the update_attributes when using the validate: option.

# @return [Hash] The Elasticsearch response as a Hash
#
def update(attributes={}, options={})
attributes = self.attributes.merge(attributes)
Copy link

Choose a reason for hiding this comment

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

This should be self.attributes = self.attributes.merge(attributes)

@estolfo
Copy link
Contributor

estolfo commented Sep 7, 2018

I'm going to close this as it's no longer relevant. We have deprecated and removed the ActiveRecord persistence pattern in version 6.0 of the elasticsearch-persistence gem.

Please consider migrating your app to use the repository pattern instead.

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