rails-uploader 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/uploader/asset.rb
CHANGED
@@ -3,6 +3,10 @@ module Uploader
|
|
3
3
|
def self.included(base)
|
4
4
|
base.send(:extend, Uploader::Asset::ClassMethods)
|
5
5
|
base.send(:include, Uploader::Asset::AssetProcessor)
|
6
|
+
|
7
|
+
base.instance_eval do
|
8
|
+
before_create :generate_public_token
|
9
|
+
end
|
6
10
|
end
|
7
11
|
|
8
12
|
module Mongoid
|
@@ -13,6 +17,8 @@ module Uploader
|
|
13
17
|
base.instance_eval do
|
14
18
|
field :guid, type: String
|
15
19
|
field :public_token, type: String
|
20
|
+
|
21
|
+
before_create :generate_public_token
|
16
22
|
end
|
17
23
|
end
|
18
24
|
|
data/lib/uploader/version.rb
CHANGED
data/spec/dummy/log/test.log
CHANGED
@@ -2327,3 +2327,165 @@ Started POST "/uploader/attachments" for 127.0.0.1 at 2013-09-07 09:36:55 +0300
|
|
2327
2327
|
[1m[35m (0.1ms)[0m begin transaction
|
2328
2328
|
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2329
2329
|
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=system.namespaces selector={:name=>{"$not"=>/system|\$/}} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.4559ms)
|
2330
|
+
Connecting to database specified by database.yml
|
2331
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
2332
|
+
Migrating to CreateAssets (20120508093416)
|
2333
|
+
Migrating to CreateArticles (20120508093830)
|
2334
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2335
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
2336
|
+
[1m[35mSQL (3.9ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["title", "MyString"], ["updated_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00]]
|
2337
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2338
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
2339
|
+
[1m[36mPicture Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'Knu8hDqR5Xaw8FxyyH6x' LIMIT 1[0m
|
2340
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "Knu8hDqR5Xaw8FxyyH6x"], ["type", "Picture"], ["updated_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["user_id", nil]]
|
2341
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2342
|
+
[1m[35mPicture Load (0.3ms)[0m SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article' LIMIT 1
|
2343
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "assets" SET "assetable_id" = 1000, "guid" = NULL WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'[0m
|
2344
|
+
[1m[35mPicture Load (0.2ms)[0m SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? LIMIT 1 [["id", 1]]
|
2345
|
+
[1m[36mPicture Load (0.2ms)[0m [1mSELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."guid" = 'qzGffLllVIuqvEzl9aI6' AND "assets"."assetable_type" = 'Article' LIMIT 1[0m
|
2346
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
2347
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2348
|
+
[1m[35m (2.0ms)[0m rollback transaction
|
2349
|
+
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (1.1053ms)
|
2350
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=system.namespaces selector={:name=>{"$not"=>/system|\$/}} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.7091ms)
|
2351
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2352
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"public_token"=>"Yywmj0UBirWTsQeRNhcc"} flags=[:slave_ok] limit=1 skip=0 fields={:_id=>1} (1.1671ms)
|
2353
|
+
MOPED: 127.0.0.1:27017 INSERT database=rails_uploader_test collection=mongoid_pictures documents=[{"_id"=>"522acfe6dc26e7e510000001", "guid"=>"guid", "assetable_type"=>"MongoidArticle", "public_token"=>"Yywmj0UBirWTsQeRNhcc"}] flags=[] (0.1330ms)
|
2354
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"$query"=>{"guid"=>"guid", "assetable_type"=>"MongoidArticle"}, "$orderby"=>{:_id=>1}} flags=[:slave_ok] limit=-1 skip=0 fields=nil (3.0901ms)
|
2355
|
+
MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:count=>"mongoid_pictures", :query=>{}} (0.3383ms)
|
2356
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.3281ms)
|
2357
|
+
MOPED: 127.0.0.1:27017 DELETE database=rails_uploader_test collection=mongoid_pictures selector={"_id"=>"522acfe6dc26e7e510000001"} flags=[:remove_first] (0.1419ms)
|
2358
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"public_token"=>"L4zXx6B2VBmykVC6UyRo"} flags=[:slave_ok] limit=1 skip=0 fields={:_id=>1} (0.4721ms)
|
2359
|
+
MOPED: 127.0.0.1:27017 INSERT database=rails_uploader_test collection=mongoid_pictures documents=[{"_id"=>"522acfe6dc26e7e510000002", "guid"=>"guid", "assetable_type"=>"MongoidArticle", "public_token"=>"L4zXx6B2VBmykVC6UyRo"}] flags=[] (0.1040ms)
|
2360
|
+
MOPED: 127.0.0.1:27017 UPDATE database=rails_uploader_test collection=mongoid_pictures selector={"guid"=>"guid", "assetable_type"=>"MongoidArticle"} update={"$set"=>{:assetable_id=>1000, :guid=>nil}} flags=[:multi] (0.1230ms)
|
2361
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={:_id=>"522acfe6dc26e7e510000002"} flags=[:slave_ok] limit=-1 skip=0 fields=nil (0.3037ms)
|
2362
|
+
MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:count=>"mongoid_pictures", :query=>{}} (0.2880ms)
|
2363
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.1962ms)
|
2364
|
+
MOPED: 127.0.0.1:27017 DELETE database=rails_uploader_test collection=mongoid_pictures selector={"_id"=>"522acfe6dc26e7e510000002"} flags=[:remove_first] (0.0849ms)
|
2365
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2366
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=system.namespaces selector={:name=>{"$not"=>/system|\$/}} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.3910ms)
|
2367
|
+
MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:drop=>"mongoid_pictures"} (1.4899ms)
|
2368
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2369
|
+
|
2370
|
+
|
2371
|
+
Started POST "/uploader/attachments" for 127.0.0.1 at 2013-09-07 10:04:06 +0300
|
2372
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
2373
|
+
[1m[36mPicture Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'C8Rq2EySL6P3SehTRxQK' LIMIT 1[0m
|
2374
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["data_content_type", nil], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", "SOMESTRING"], ["public_token", "C8Rq2EySL6P3SehTRxQK"], ["type", "Picture"], ["updated_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["user_id", nil]]
|
2375
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2376
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
2377
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "MyText"], ["created_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["title", "MyString"], ["updated_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00]]
|
2378
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2379
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2380
|
+
[1m[35mPicture Exists (0.1ms)[0m SELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'tqxRTWEpn4BqsxDlPfuj' LIMIT 1
|
2381
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "tqxRTWEpn4BqsxDlPfuj"], ["type", "Picture"], ["updated_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["user_id", nil]]
|
2382
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
2383
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')[0m
|
2384
|
+
|
2385
|
+
|
2386
|
+
Started DELETE "/uploader/attachments/tqxRTWEpn4BqsxDlPfuj" for 127.0.0.1 at 2013-09-07 10:04:06 +0300
|
2387
|
+
[1m[35mPicture Load (0.2ms)[0m SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'tqxRTWEpn4BqsxDlPfuj' LIMIT 1
|
2388
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
2389
|
+
[1m[35mSQL (0.2ms)[0m DELETE FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? [["id", 2]]
|
2390
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2391
|
+
[1m[35m (0.2ms)[0m SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
|
2392
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
2393
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["title", "MyString"], ["updated_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00]]
|
2394
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2395
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2396
|
+
[1m[36mPicture Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'Xb7PKB2LXSVBDec1O0IC' LIMIT 1[0m
|
2397
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "Xb7PKB2LXSVBDec1O0IC"], ["type", "Picture"], ["updated_at", Sat, 07 Sep 2013 07:04:06 UTC +00:00], ["user_id", nil]]
|
2398
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2399
|
+
|
2400
|
+
|
2401
|
+
Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2013-09-07 10:04:06 +0300
|
2402
|
+
[1m[35mPicture Load (0.2ms)[0m SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'wrong' LIMIT 1
|
2403
|
+
|
2404
|
+
|
2405
|
+
Started POST "/uploader/attachments" for 127.0.0.1 at 2013-09-07 10:04:06 +0300
|
2406
|
+
[1m[36m (1.8ms)[0m [1mrollback transaction[0m
|
2407
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=system.namespaces selector={:name=>{"$not"=>/system|\$/}} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.5581ms)
|
2408
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2409
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2410
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=system.namespaces selector={:name=>{"$not"=>/system|\$/}} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.4041ms)
|
2411
|
+
Connecting to database specified by database.yml
|
2412
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
2413
|
+
Migrating to CreateAssets (20120508093416)
|
2414
|
+
Migrating to CreateArticles (20120508093830)
|
2415
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2416
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
2417
|
+
[1m[35mSQL (2.8ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["title", "MyString"], ["updated_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00]]
|
2418
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2419
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
2420
|
+
[1m[36mPicture Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = '5gWTuo6sPQw3jVnDHJoO' LIMIT 1[0m
|
2421
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "5gWTuo6sPQw3jVnDHJoO"], ["type", "Picture"], ["updated_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["user_id", nil]]
|
2422
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2423
|
+
[1m[35mPicture Load (0.2ms)[0m SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article' LIMIT 1
|
2424
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "assets" SET "assetable_id" = 1000, "guid" = NULL WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'[0m
|
2425
|
+
[1m[35mPicture Load (0.1ms)[0m SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? LIMIT 1 [["id", 1]]
|
2426
|
+
[1m[36mPicture Load (0.2ms)[0m [1mSELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."guid" = 'u2IPtxEHxorm0YLjgmI9' AND "assets"."assetable_type" = 'Article' LIMIT 1[0m
|
2427
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
2428
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2429
|
+
[1m[35m (1.8ms)[0m rollback transaction
|
2430
|
+
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (27.6401ms)
|
2431
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=system.namespaces selector={:name=>{"$not"=>/system|\$/}} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.4771ms)
|
2432
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2433
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"public_token"=>"j0DvBMyDYUrK2HsbTAVY"} flags=[:slave_ok] limit=1 skip=0 fields={:_id=>1} (0.7830ms)
|
2434
|
+
MOPED: 127.0.0.1:27017 INSERT database=rails_uploader_test collection=mongoid_pictures documents=[{"_id"=>"522ad012dc26e74611000001", "guid"=>"guid", "assetable_type"=>"MongoidArticle", "public_token"=>"j0DvBMyDYUrK2HsbTAVY"}] flags=[] (0.1552ms)
|
2435
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"$query"=>{"guid"=>"guid", "assetable_type"=>"MongoidArticle"}, "$orderby"=>{:_id=>1}} flags=[:slave_ok] limit=-1 skip=0 fields=nil (1.0440ms)
|
2436
|
+
MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:count=>"mongoid_pictures", :query=>{}} (0.2849ms)
|
2437
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.1972ms)
|
2438
|
+
MOPED: 127.0.0.1:27017 DELETE database=rails_uploader_test collection=mongoid_pictures selector={"_id"=>"522ad012dc26e74611000001"} flags=[:remove_first] (0.1140ms)
|
2439
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"public_token"=>"IWWLVLVjHWTF8hEyeX03"} flags=[:slave_ok] limit=1 skip=0 fields={:_id=>1} (0.3612ms)
|
2440
|
+
MOPED: 127.0.0.1:27017 INSERT database=rails_uploader_test collection=mongoid_pictures documents=[{"_id"=>"522ad012dc26e74611000002", "guid"=>"guid", "assetable_type"=>"MongoidArticle", "public_token"=>"IWWLVLVjHWTF8hEyeX03"}] flags=[] (0.0908ms)
|
2441
|
+
MOPED: 127.0.0.1:27017 UPDATE database=rails_uploader_test collection=mongoid_pictures selector={"guid"=>"guid", "assetable_type"=>"MongoidArticle"} update={"$set"=>{:assetable_id=>1000, :guid=>nil}} flags=[:multi] (0.1318ms)
|
2442
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={:_id=>"522ad012dc26e74611000002"} flags=[:slave_ok] limit=-1 skip=0 fields=nil (0.2830ms)
|
2443
|
+
MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:count=>"mongoid_pictures", :query=>{}} (0.3629ms)
|
2444
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.2522ms)
|
2445
|
+
MOPED: 127.0.0.1:27017 DELETE database=rails_uploader_test collection=mongoid_pictures selector={"_id"=>"522ad012dc26e74611000002"} flags=[:remove_first] (0.1061ms)
|
2446
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2447
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=system.namespaces selector={:name=>{"$not"=>/system|\$/}} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.5782ms)
|
2448
|
+
MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:drop=>"mongoid_pictures"} (1.0571ms)
|
2449
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2450
|
+
|
2451
|
+
|
2452
|
+
Started POST "/uploader/attachments" for 127.0.0.1 at 2013-09-07 10:04:50 +0300
|
2453
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
2454
|
+
[1m[36mPicture Exists (0.2ms)[0m [1mSELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'bPoLoZa2Ep7DKResUDxs' LIMIT 1[0m
|
2455
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["data_content_type", nil], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", "SOMESTRING"], ["public_token", "bPoLoZa2Ep7DKResUDxs"], ["type", "Picture"], ["updated_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["user_id", nil]]
|
2456
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2457
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
2458
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m [["content", "MyText"], ["created_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["title", "MyString"], ["updated_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00]]
|
2459
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2460
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2461
|
+
[1m[35mPicture Exists (0.1ms)[0m SELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'Fpscree6yUIhzLooEerX' LIMIT 1
|
2462
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)[0m [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "Fpscree6yUIhzLooEerX"], ["type", "Picture"], ["updated_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["user_id", nil]]
|
2463
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
2464
|
+
[1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')[0m
|
2465
|
+
|
2466
|
+
|
2467
|
+
Started DELETE "/uploader/attachments/Fpscree6yUIhzLooEerX" for 127.0.0.1 at 2013-09-07 10:04:50 +0300
|
2468
|
+
[1m[35mPicture Load (0.2ms)[0m SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'Fpscree6yUIhzLooEerX' LIMIT 1
|
2469
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2470
|
+
[1m[35mSQL (0.2ms)[0m DELETE FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? [["id", 2]]
|
2471
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2472
|
+
[1m[35m (0.1ms)[0m SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
|
2473
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
2474
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["title", "MyString"], ["updated_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00]]
|
2475
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2476
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2477
|
+
[1m[36mPicture Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 't8yacSJYFoJoU4xedqHd' LIMIT 1[0m
|
2478
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "t8yacSJYFoJoU4xedqHd"], ["type", "Picture"], ["updated_at", Sat, 07 Sep 2013 07:04:50 UTC +00:00], ["user_id", nil]]
|
2479
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2480
|
+
|
2481
|
+
|
2482
|
+
Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2013-09-07 10:04:50 +0300
|
2483
|
+
[1m[35mPicture Load (0.1ms)[0m SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'wrong' LIMIT 1
|
2484
|
+
|
2485
|
+
|
2486
|
+
Started POST "/uploader/attachments" for 127.0.0.1 at 2013-09-07 10:04:50 +0300
|
2487
|
+
[1m[36m (1.8ms)[0m [1mrollback transaction[0m
|
2488
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=system.namespaces selector={:name=>{"$not"=>/system|\$/}} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.5462ms)
|
2489
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2490
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2491
|
+
MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=system.namespaces selector={:name=>{"$not"=>/system|\$/}} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.3948ms)
|
Binary file
|
Binary file
|