Open pradosh987 opened 6 years ago
Yeah, I’m kinda in the same boat — this design seems really weird to me. I’m not sure what I’m missing. I literally just wrote this code;
MyappStorage.Avatar.url({"", user},:thumb)
Which seems kinda pointless...
I was looking into using arc with phoenix to handle some images. Even though documentation is good enough, I am still confused about filename used in while storing a file and calling url method. General approach is to create a string field in database column and save file name into it. Even ecto_arc is built around same concept. So my question is, suppose I override
filename
method and make it dependent only model.uuid(actual uuid but not primary key) then why is it necessary to store filename in database in first place, or why is it required to pass filename while callingstore
orurl
methods. In my case filename serve no useful purpose. Shouldn't I able to do so by passing model as scope only?Consider an example
Two boolean fields can tell if user has uploaded avatar and cover image.
Note: I am coming from Ruby on Rails and relatively new to Elixir eco system, so please forgive if I make some mistake or wrong assumption