Skip to content

Instantly share code, notes, and snippets.

@enricostano
Created November 18, 2012 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enricostano/4105311 to your computer and use it in GitHub Desktop.
Save enricostano/4105311 to your computer and use it in GitHub Desktop.
1.9.3p194 :002 > album = Album.last
Album Load (0.4ms) SELECT "albums".* FROM "albums" ORDER BY "albums"."id" DESC LIMIT 1
=> #<Album id: 13, name: "hhhh", cover_image_uid: "2012/11/18/14_57_41_751_file", created_at: "2012-11-18 13:57:41", updated_at: "2012-11-18 13:57:41">
1.9.3p194 :003 > album.cover_image.url
=> "/media/BAhbBlsHOgZmSSIhMjAxMi8xMS8xOC8xNF81N180MV83NTFfZmlsZQY6BkVU"
Started POST "/api/albums" for 127.0.0.1 at 2012-11-18 14:57:40 +0100
Processing by AlbumsController#create as JSON
Parameters: {"name"=>"hhhh", "cover_image"=>"img2.jpg", "album"=>{"cover_image"=>"img2.jpg", "name"=>"hhhh"}}
(0.1ms) begin transaction
None of the functions registered with #<Dragonfly::Analyser:0x000000028e2d60> were able to deal with the method call format(<Dragonfly::TempObject data="img2.jpg" >). You may need to register one that can.
SQL (5.5ms) INSERT INTO "albums" ("cover_image_uid", "created_at", "name", "updated_at") VALUES (?, ?, ?, ?) [["cover_image_uid", "2012/11/18/14_57_41_751_file"], ["created_at", Sun, 18 Nov 2012 13:57:41 UTC +00:00], ["name", "hhhh"], ["updated_at", Sun, 18 Nov 2012 13:57:41 UTC +00:00]]
(174.6ms) commit transaction
Completed 201 Created in 982ms (Views: 1.7ms | ActiveRecord: 180.2ms)
$ lsla public/system/dragonfly/development/2012/11/18/
total 16
drwxr-xr-x 2 enrico users 4096 Nov 18 14:57 .
drwxr-xr-x 3 enrico users 4096 Nov 18 14:57 ..
-rw-r--r-- 1 enrico users 8 Nov 18 14:57 14_57_41_751_file
-rw-r--r-- 1 enrico users 61 Nov 18 14:57 14_57_41_751_file.meta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment