🤔 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)