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
On Rails 5.1 when a field was changed you would get the key: [FileUpload..., FileUpload] (or whatever Upload) objects when calling changes. In Rails 5.2, changes its only giving back nils for the before and after change information, as in key: [nil, nil]. This is a fairly big problem if you're trying to introspect and make decisions about how the content might have changed.
Test code:
m = ActiveRecord::Migration.new
m.create_table :lorems do |t|
t.string :image
end
class Lorem < ActiveRecord::Base
mount_uploader :image, FileUploader
end
l = Lorem.new
l.image = File.new('/etc/paths')
puts l.changes
On Rails 5.1 when a field was changed you would get the
key: [FileUpload..., FileUpload]
(or whatever Upload) objects when callingchanges
. In Rails 5.2,changes
its only giving back nils for the before and after change information, as inkey: [nil, nil]
. This is a fairly big problem if you're trying to introspect and make decisions about how the content might have changed.Test code:
Results under Rails 5.1
Results under Rails 5.2
The text was updated successfully, but these errors were encountered: