paperdragon icon indicating copy to clipboard operation
paperdragon copied to clipboard

Paperdragon does not work with PostgreSQL's JSON type

Open siegfried opened this issue 10 years ago • 0 comments

I failed to delete the uploaded file when I was using JSON type as the meta data column type.

ArgumentError:
       Dragonfly::TempObject must be initialized with a String, a Pathname, a File, a Tempfile, another TempObject, something that responds to .tempfile, or something that responds to .path - you gave nil

I believe the root cause is that Paperdragon retrieves values with keys in symbol, while all the keys in JSON type are Strings.

Hash of serialised text:

{:original=>{:width=>100, :height=>100, :uid=>"original-black.png"}, :thumbnail=>{:width=>300, :height=>200, :uid=>"thumbnail-black.png"}}

Hash of JSON:

{"original"=>{"width"=>100, "height"=>100, "uid"=>"original-black.png"}, "thumbnail"=>{"width"=>300, "height"=>200, "uid"=>"thumbnail-black.png"}}

siegfried avatar Dec 08 '15 13:12 siegfried