`updated_at` is not included in changes when `default_value_for` is used
In app/models/note.rb we have: default_value_for :system, false.
When I do:
note = Note.where(type: nil).first # or any regular note
note.becomes!(DiscussionNote).save
The UPDATE query here only updates type and does not touch updated_at.
If I remove default_value_for :system, false, it works normally and updated_at gets touched.
If I do:
note = Note.where(type: nil).first # or any regular note
note.type = DiscussionNote
note.save
It works normally too.
I would like to use becomes! though because it also changes the class of note to DiscussionNote.
I tried digging into ActiveRecord's dirty tracking and I'm not sure why updated_at is not included in the dirty attributes for the non-working case above.