I have a Message model which had
class Message < ApplicationRecord
has_one_attached :attachment
but now I need to convert it to :
class Message < ApplicationRecord
has_many_attached :attachments
to enable multiple attachments for messages
So I changed has_one_attached to has_many_attached in the model Message
but when I run message.attachments.attached? it returns false to existing attachment. It works correctly for the newly attached files.
Should I be adding a migration or a one time rake task which manually adds/converts the attachments?
What is the correct way of doing this?