π€ What does it mean about 'run a migration'
According to Rails Guide, it says
βοΈ My Situation
I changed my model name
- From: Media
- To: Medium
Then
All of the objects had not had any attachment.
π§ WHY?
ActiveStrage is the polymorphic model. So, the records were still looking at the old model. Then, the association is cut.
π§Treatment from Rails Console
ActiveStorage::Attachment.where(record_type: "Media").update(record_type: "Medium")
Top comments (0)