I have just updated RAILS to RAILS 6.1.
And I want to attach different PDF attachments onto one model.
And I was reading on another web page that RAILS now supported mutiple has_one_attached
statements in one model.
I don’t mean the has_many_attached !!!
In my usecase the model needs to attach a invoice and a credit advice.
So I have a model file looks like :
... has_one_attached :invoice _paper, service: :upload_invoice_paper has_one_attached :credit_paper, service: :upload_credit_paper ...
And the corresponding storage.yml :
upload_invoice_paper: service: Disk root: <%= Rails.root.join("uploads/invoice_paper") %> upload_credit_paper: service: Disk root: <%= Rails.root.join("uploads/credit_paper") %>
But when I try to run this code, I get :
ArgumentError (Cannot configure service :upload_credit_paper for OrderNow#credit_paper):
So it seems to be the second statement of
has_one_attached will NOT be supported.