carrierwave-postgresql icon indicating copy to clipboard operation
carrierwave-postgresql copied to clipboard

Content-type not being stored

Open rhelsing opened this issue 8 years ago • 1 comments

I may be doing something wrong as I am just getting started with this library but the examples show the identifier being saved as 'file.png' but mine is always a digit '45838' without the extension. Is this a property of OID or did I configure it incorrectly? When I run model.obj.content_type I get nil. Is there something extra I need to do for that to work properly? Either when saving the file or in my uploader class?

rhelsing avatar Sep 18 '17 19:09 rhelsing

What is stored on the model is a pointer ID to the large object in postgres. This gem doesn't make an effort to keep filename or content_type because it just stores the bytes in postgres. If you want to maintain those qualities I would suggest saving them to the model itself.

TheKidCoder avatar Jan 18 '18 21:01 TheKidCoder