As a part of my idea of Yandex Disk as ActiveStorage service implementation, I decided to implement PROPPATCH method into yandex disk gem.
As described in webdav documentation - all what we need - make a special PROPPATCH request with PATH of our folder or file.
We need to set proper option in development.rb:
When we need to add special section ino storage.yml file:
Let’s create /lib/active_storage/service/yandex_disk_service.rb.
We need to inherit our new service from Service
Of course, it’s not a final implementation, we should implement another methods, as described here:
current active_storage services.
For example azure_storage_service.rb:
Let’s take a look, how is our draft implementation working with our Job model with company_logo attachment:
And the output:
If you do a simple select on ActiveStorage tables, you can see our uploaded image information.
Of course, it’s not a final implementation - it’s just a draft, but I’ll continue work when I have more free time, and I hope you understood main idea.