-
Notifications
You must be signed in to change notification settings - Fork 57
Description
ActiveModel::Dirty#previous_changes (http://api.rubyonrails.org/classes/ActiveModel/Dirty.html#method-i-previous_changes) don't return attributes out of ar_typed_store field.
Model :
class Product < ActiveRecord::Base
typed_store :ar_typed_store do |s|
s.string :attr_in_ar_typed_store
end
endTo reproduce that issue :
a = Product.find(x)
a.attr_in_ar_typed_store = 'test'
a.save #=> true
puts a.previous_changesWork on 1.1.1 with Rails 4.2 (ar_typed_store appears and attr_in_ar_typed_store too) :
{"ar_typed_store"=>[{"attr_in_ar_typed_store"...},{"attr_in_ar_typed_store"...}], "attr_in_ar_typed_store"=>[nil, 'test'], updated_at"=>[Tue, 27 Jun 2017 09:53:32 UTC +00:00, Tue, 27 Jun 2017 09:56:28 UTC +00:00]}
Don't work on 1.1.1 with Rails 5.1.1 (ar_typed_store appears but not attr_in_ar_typed_store)
# {"ar_typed_store"=>[{"attr_in_ar_typed_store"...},{"attr_in_ar_typed_store"...}], updated_at"=>[Tue, 27 Jun 2017 09:53:32 UTC +00:00, Tue, 27 Jun 2017 09:56:28 UTC +00:00]}
EDIT : works in rails 4.2 with Activerecord-Typedstore 1.1.1