madeintandem/hstore_accessor

Only mark as changed if value has changed

aaronchi opened this issue · 2 comments

hstore_accessor marks the column as changed when set, even if the value is the same. It should only be marked changed if the value is different than the current value.

> user = User.first
> user.changed?
=> false
> user.show_labels
=> true
> user.show_labels = true
> user.changed?
=> true
> user.changes
=> => {"show_labels"=>[true, true]}

Fixed by #35

Should be fixed by #35 which is merged now and will be released shortly to rubygems.