clintongormley / Elastic-Model

Use ElasticSearch as a NoSQL database in Perl
9 stars 8 forks source link

has_changed() and old_values() buggy #23

Closed clintongormley closed 11 years ago

clintongormley commented 11 years ago

The has_changed() and old_values() functionality relies on triggers being called whenever a setter or clearer is called on an attribute.

However, this doesn't work for any complex value (eg hashref/arrayref) as the ref itself might change, without the contents being altered.

Also, these triggers aren't being applied to any attributes included from roles.

Keeping track of changing attributes adds quite a lot of overhead and impacted performance, but we currently have to do it because save() only saves if the object has changed.