Skip to content

Paperdragon does not work with PostgreSQL's JSON type #6

@siegfried

Description

@siegfried

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"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions