Reading store attribute with the default value populates changes
palkan opened this issue · 2 comments
palkan commented
Example:
class User < ActiveRecord::Base
store_attribute :meta, :last_updated_at, :date, default: -> { Date.new }
end
u = User.first; nil
=> nil
» u.changes
=> {}
» u.meta['foo']
=> nil
» u.changes
=> {"meta"=>
[{"last_updated_at"=>Thu, 10 Sep 2020},
{"last_updated_at"=>Thu, 10 Sep 2020}]}
markedmondson commented
Just ran into this again. Are you soliciting for a fix? :)
palkan commented
Yeah, I would be glad to merge a PR with a fix :)