carrierwaveuploader / carrierwave

Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
https://github.com/carrierwaveuploader/carrierwave
8.78k stars 1.65k forks source link

Adding blurhash to json field #2743

Open vizakenjack opened 1 month ago

vizakenjack commented 1 month ago

I have a project with users, one user can have up to 3 photos with original size, medium size and small size. I use Postgres and jsonb field, and it works perfectly with 'mount_uploaders'.

How can I add a blurhash without creating additional fields or tables?

In my current structure, I have something like this:

[
  {
    "url": "...",
    "medium": {
      "url": "...",
    },
    "small": {
      "url": "...",
    },
  },
...
]

Is it possible to add custom attributes in this json? Tried to find something in wiki, but only found a solution where additional database fields are being added.