You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[MODEL] Fixed #dup behaviour for Elasticsearch::Model
Previously, calling #dup for an Elasticsearch::Model instance would
retain the original __elasticsearch__ reference. Given the following
example:
user = User.create!(name: "Will")
other = user.dup
other.update!(name: "Bill")
You'd end up with two references to "Will" in Elasticsearch, and none
for "Bill," because the duplicate instance proxied to the original
instance's attributes.
With this fix, each duplicate gets its own proxy, so attributes are
saved correctly.
Closeselastic#517
0 commit comments