Rails 5.2 Active Storage add custom attributes : <p>I have a model with attachments:</p>

<pre class="lang-rb prettyprint-override"><code>class Project &lt; ApplicationRecord
  has_many_attached :images
end
</code></pre>



<p>When I attach and save the image I also want to save an additional custom attribute - <code>display_order</code> (integer) with the attached image. I want to use it to sort the attached images and display them in the order I specified in this custom attribute. I've reviewed ActiveStorage source code for <code>#attach</code> method as well as <code>ActiveStorage::Blob</code> model but it looks like there is no built in method to pass some custom metadata.</p>

<p>I wonder, what's the idiomatic way to solve this problem with ActiveStorage? In the past I would usually just add a <code>display_order</code> attribute to the ActiveRecord model which represents my attachment and then simply use it with <code>.order(display_order: :asc)</code> query.</p>
