Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
siegfried opened this issue Dec 8, 2015 · 0 comments
Open

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

siegfried opened this issue Dec 8, 2015 · 0 comments

Comments

@siegfried
Copy link

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"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant