{"action":"closed","issue":{"url":"https://api.github.com/repos/janko-m/shrine/issues/24","labels_url":"https://api.github.com/repos/janko-m/shrine/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/janko-m/shrine/issues/24/comments","events_url":"https://api.github.com/repos/janko-m/shrine/issues/24/events","html_url":"https://github.com/janko-m/shrine/issues/24","id":120248913,"number":24,"title":"Issue when trying to upload cached s3 file","user":{"login":"Chocksy","id":178892,"avatar_url":"https://avatars.githubusercontent.com/u/178892?v=3","gravatar_id":"","url":"https://api.github.com/users/Chocksy","html_url":"https://github.com/Chocksy","followers_url":"https://api.github.com/users/Chocksy/followers","following_url":"https://api.github.com/users/Chocksy/following{/other_user}","gists_url":"https://api.github.com/users/Chocksy/gists{/gist_id}","starred_url":"https://api.github.com/users/Chocksy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chocksy/subscriptions","organizations_url":"https://api.github.com/users/Chocksy/orgs","repos_url":"https://api.github.com/users/Chocksy/repos","events_url":"https://api.github.com/users/Chocksy/events{/privacy}","received_events_url":"https://api.github.com/users/Chocksy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-03T19:25:00Z","updated_at":"2015-12-04T14:23:06Z","closed_at":"2015-12-04T14:23:06Z","body":"I'm trying to do `@user.avatar = params[:user][:avatar]` on an avatar file that was uploaded via jquery.fileupload. The params look like this:\r\n`{\"user\"=>{\"avatar\"=>{\"id\"=>\"f52c607d73a78858532eefdd303ffa8685d5771edd821a9e256dbd88322a\", \"storage\"=>\"cache\", \"metadata\"=>{\"size\"=>\"97874\", \"filename\"=>\"skylanders_swap_force_ps4-01.jpg\", \"mime_type\"=>\"image/jpeg\"}}}}`\r\n\r\nThe problem is that the gem can't pick this up as an io:\r\n`Shrine::InvalidFile: {\"id\"=>\"f52c607d73a78858532eefdd303ffa8685d5771edd821a9e256dbd88322a\", \"storage\"=>\"cache\", \"metadata\"=>{\"size\"=>\"97874\", \"filename\"=>\"skylanders_swap_force_ps4-01.jpg\", \"mime_type\"=>\"image/jpeg\"}} is not a valid IO object (it doesn't respond to `read(length, outbuf)`, `eof?()`, `rewind()`, `close()`)\r\nfrom /Users/razvanciocanel/.rvm/gems/ruby-2.1.5@rails4/bundler/gems/shrine-39c045174f49/lib/shrine.rb:357:in `_enforce_io'`\r\n\r\nThis worked with version 0.9.0 but now it does now with version 1.0.0.\r\n\r\nWhat changed? \r\n\r\n----\r\n\r\nOther details:\r\n\r\nshrine.rb file:\r\n```\r\nrequire \"shrine\"\r\nrequire \"shrine/storage/file_system\"\r\nrequire \"shrine/storage/s3\"\r\nrequire \"shrine/plugins/activerecord\"\r\n\r\ns3_options = {\r\n  access_key_id:     ENV['AWS_ACCESS_KEY_ID'],      # \"xyz\"\r\n  secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],  # \"abc\"\r\n  region:            ENV['AWS_REGION'],             # \"eu-west-1\"\r\n  bucket:            ENV['AWS_BUCKET'],             # \"my-app\"\r\n}\r\n\r\nif Rails.env.development?\r\n  s3_options.merge!({\r\n    endpoint:           ENV[\"AWS_ENDPOINT\"],\r\n    host:               \"#{ENV[\"AWS_ENDPOINT\"]}/#{ENV[\"AWS_BUCKET\"]}/\",\r\n    force_path_style:   true\r\n  })\r\nend\r\n\r\nShrine.storages = {\r\n  cache: Shrine::Storage::S3.new(prefix: \"cache\", **s3_options),\r\n  store: Shrine::Storage::S3.new(prefix: \"store\", **s3_options),\r\n}\r\n\r\nShrine.plugin :direct_upload, presign: true, max_size: nil #20*1024*1024\r\nShrine.plugin :background_helpers\r\n\r\nShrine::Attacher.promote { |data| ShrineUploadJob.perform_async(data) }\r\nShrine::Attacher.delete { |data| ShrineDeleteJob.perform_async(data) }\r\n```\r\n\r\n"}}