ActiveStorage - next steps and how to help?

Hello world-changing Rubyists,

I’m experimenting with ActiveStorage and questions popped up. Since they revolve around features, I thought I’d post them here.

Most of the „missing“ features have been listed by the author of Shrine in this reddit post, yet not all of them are necessary to begin using ActiveStorage in production or early alpha.

One feature I find important though is handling validation errors. I don’t want Blobs in my database which are never actually attached to my records. Would that not be the next feature to implement?

That is to say, solving this exclamation-mark riddle in the current README in ActiveStorage:

def create
  message = Message.create! params.require(:message).permit(:title, :content  )
message.images.attach(params[:message][:images])
end

``

But let’s say that I can work around that with transactions and JS validations, I’d still be facing another problem. I have one S3 bucket per environment and everything neatly organized in directories, yet ActiveSupport clutters up the root directory.

Would that conceptually be solved like this commit?

Lastly, if I were to document for developers how to use ActiveStorage (even in this early stage) - would I do that right in the ActiveStorage README? I’m missing the up-to-date equivalent to this section.

Thank you for your guidance.

halo

The assignment problem I mentioned has been solved yesterday by George Claghorn: https://github.com/rails/rails/pull/31182

Thank you!

I’m still seeking guidance on the S3 prefix problem, though:

https://github.com/halo/rails/commit/c8bc88dbfa4c73813b7459a80c0c4f7e83d13980

Would a fifth keyword argument to the S3 service be a good approach?

Thank you for your time.