acts_as_assets 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,14 +15,14 @@ class ActsAsAssets::AssetsController < ApplicationController
15
15
  def create
16
16
  name = root_model_name
17
17
  klazz = ([name.pluralize.camelize] << camelize_type.flatten).join('::')
18
- @asset = klazz.constantize.create!(:asset => params[:file],
18
+ @asset = klazz.constantize.create(:asset => params[:file],
19
19
  "#{name}".to_sym => instance_variable_get("@#{name}".to_sym))
20
20
 
21
21
  respond_to do |format|
22
22
  if @asset.valid?
23
23
  format.js
24
24
  else
25
- format.js { render :json =>{:errors => @asset.errors}, :status => 406 }
25
+ format.js { render :json =>{:success => false, :errors => @asset.errors}}
26
26
  end
27
27
  end
28
28
  end
@@ -40,7 +40,7 @@ class ActsAsAssets::AssetsController < ApplicationController
40
40
  if error.nil?
41
41
  format.js
42
42
  else
43
- format.js { render :json => {:errors => error}, :status => 406 }
43
+ format.js { render :json => {:success => false, :errors => error}}
44
44
  end
45
45
  end
46
46
 
@@ -1,2 +1,3 @@
1
- acts_as_assets:
2
- unique_asset_error: 'Un solo documento di questo tipo può essere caricato. Eliminare il file attuale per sostituirlo.'
1
+ it:
2
+ acts_as_assets:
3
+ unique_asset_error: 'Un solo documento di questo tipo può essere caricato. Eliminare il file attuale per sostituirlo.'
@@ -20,7 +20,7 @@ module ActsAsAssets
20
20
 
21
21
  belongs_to root_model
22
22
  has_attached_file :asset,
23
- :url => "/#{root_model.to_s.pluralize}/:acts_as_assets_root_id/assets/:acts_as_assets_asset_id",
23
+ :url => "/#{root_model.to_s.pluralize}/:acts_as_assets_root_id/assets/:acts_as_assets_asset_id/download",
24
24
  :path => ":acts_as_assets_file_path/:acts_as_assets_file_name.:extension"
25
25
  before_create :touch_counter
26
26
 
@@ -1,3 +1,3 @@
1
1
  module ActsAsAssets
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -106,7 +106,7 @@ describe "ActsAsAssets" do
106
106
  b = book
107
107
  doc = Books::Assets::TestDoc.create! :asset => jpg_test, :book => b
108
108
  @dtbd << doc
109
- doc.asset.url.should match /\/books\/#{b.id}\/assets\/#{doc.id}/
109
+ doc.asset.url.should match /\/books\/#{b.id}\/assets\/#{doc.id}\/download/
110
110
  end
111
111
 
112
112
  end
Binary file
@@ -17378,3 +17378,533 @@ Completed 200 OK in 15ms (Views: 0.8ms | ActiveRecord: 4.7ms)
17378
17378
  SQL (2.6ms) DELETE FROM "books"
17379
17379
  SQL (3.9ms) DELETE FROM "books_assets"
17380
17380
  SQL (3.5ms) DELETE FROM "books"
17381
+  (0.2ms) select sqlite_version(*)
17382
+  (3.2ms) CREATE TABLE "books" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255))
17383
+  (3.7ms) CREATE TABLE "books_assets" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "asset_file_name" varchar(255), "asset_content_type" varchar(255), "asset_file_size" integer, "asset_updated_at" datetime, "type" varchar(255), "counter" integer DEFAULT 0 NOT NULL, "book_id" integer) 
17384
+ SQL (2.9ms) DELETE FROM "books_assets"
17385
+ SQL (3.0ms) DELETE FROM "books"
17386
+ SQL (2.8ms) DELETE FROM "books_assets"
17387
+ SQL (4.1ms) DELETE FROM "books"
17388
+ SQL (2.6ms) DELETE FROM "books_assets"
17389
+ SQL (2.9ms) DELETE FROM "books"
17390
+ SQL (3.1ms) DELETE FROM "books_assets"
17391
+ SQL (2.9ms) DELETE FROM "books"
17392
+ SQL (3.7ms) DELETE FROM "books_assets"
17393
+ SQL (3.1ms) DELETE FROM "books"
17394
+ SQL (3.5ms) DELETE FROM "books_assets"
17395
+ SQL (3.1ms) DELETE FROM "books"
17396
+ SQL (3.1ms) DELETE FROM "books_assets"
17397
+ SQL (3.9ms) DELETE FROM "books"
17398
+  (0.1ms) begin transaction
17399
+ SQL (0.4ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17400
+  (3.7ms) commit transaction
17401
+  (0.1ms) begin transaction
17402
+  (0.3ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 1
17403
+ SQL (0.6ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", nil], ["asset_file_name", nil], ["asset_file_size", nil], ["asset_updated_at", nil], ["book_id", 1], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17404
+ [paperclip] Saving attachments.
17405
+  (2.6ms) commit transaction
17406
+ SQL (2.5ms) DELETE FROM "books_assets"
17407
+ SQL (2.4ms) DELETE FROM "books"
17408
+  (0.1ms) begin transaction
17409
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17410
+  (2.3ms) commit transaction
17411
+  (0.1ms) begin transaction
17412
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 2
17413
+ SQL (0.2ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", nil], ["asset_file_name", nil], ["asset_file_size", nil], ["asset_updated_at", nil], ["book_id", 2], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17414
+ [paperclip] Saving attachments.
17415
+  (2.4ms) commit transaction
17416
+ SQL (2.8ms) DELETE FROM "books_assets"
17417
+ SQL (2.6ms) DELETE FROM "books"
17418
+  (0.1ms) begin transaction
17419
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17420
+  (2.5ms) commit transaction
17421
+  (0.1ms) begin transaction
17422
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 3
17423
+ SQL (0.3ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", nil], ["asset_file_name", nil], ["asset_file_size", nil], ["asset_updated_at", nil], ["book_id", 3], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17424
+ [paperclip] Saving attachments.
17425
+  (2.6ms) commit transaction
17426
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = 3 LIMIT 1
17427
+ SQL (2.7ms) DELETE FROM "books_assets"
17428
+ SQL (2.6ms) DELETE FROM "books"
17429
+  (0.1ms) begin transaction
17430
+ SQL (0.2ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17431
+  (2.3ms) commit transaction
17432
+  (0.1ms) begin transaction
17433
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 4
17434
+ SQL (0.3ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", nil], ["asset_file_name", nil], ["asset_file_size", nil], ["asset_updated_at", nil], ["book_id", 4], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17435
+ [paperclip] Saving attachments.
17436
+  (2.5ms) commit transaction
17437
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = 4 LIMIT 1
17438
+ SQL (4.2ms) DELETE FROM "books_assets"
17439
+ SQL (2.5ms) DELETE FROM "books"
17440
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" IS NULL
17441
+ SQL (3.7ms) DELETE FROM "books_assets"
17442
+ SQL (2.4ms) DELETE FROM "books"
17443
+  (0.1ms) begin transaction
17444
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" IS NULL
17445
+ SQL (0.3ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", nil], ["asset_file_name", nil], ["asset_file_size", nil], ["asset_updated_at", nil], ["book_id", nil], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17446
+ [paperclip] Saving attachments.
17447
+  (2.3ms) commit transaction
17448
+  (0.1ms) begin transaction
17449
+  (0.3ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" IS NULL
17450
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", nil], ["asset_file_name", nil], ["asset_file_size", nil], ["asset_updated_at", nil], ["book_id", nil], ["counter", 2], ["type", "Books::Assets::TestDoc"]]
17451
+ [paperclip] Saving attachments.
17452
+  (3.5ms) commit transaction
17453
+ Books::Asset Load (0.3ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."id" = ? LIMIT 1 [["id", 5]]
17454
+ Books::Asset Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."id" = ? LIMIT 1 [["id", 6]]
17455
+ SQL (2.6ms) DELETE FROM "books_assets"
17456
+ SQL (2.7ms) DELETE FROM "books"
17457
+  (0.1ms) begin transaction
17458
+ SQL (0.4ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17459
+  (2.3ms) commit transaction
17460
+  (0.1ms) begin transaction
17461
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 5
17462
+ SQL (34.3ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:00 UTC +00:00], ["book_id", 5], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17463
+ [paperclip] Saving attachments.
17464
+ [paperclip] saving public/system/books/5/assets/test_doc.jpg
17465
+  (55.4ms) commit transaction
17466
+ SQL (366.0ms) DELETE FROM "books_assets"
17467
+ SQL (33.1ms) DELETE FROM "books"
17468
+  (0.1ms) begin transaction
17469
+ SQL (0.2ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17470
+  (2.5ms) commit transaction
17471
+  (0.1ms) begin transaction
17472
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 6
17473
+ SQL (0.5ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:00 UTC +00:00], ["book_id", 6], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17474
+ [paperclip] Saving attachments.
17475
+ [paperclip] saving public/system/books/6/assets/test_doc.jpg
17476
+  (5.8ms) commit transaction
17477
+  (0.1ms) begin transaction
17478
+ [paperclip] Scheduling attachments for deletion.
17479
+ SQL (0.2ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 5]]
17480
+ [paperclip] Deleting attachments.
17481
+  (0.1ms) commit transaction
17482
+  (0.0ms) begin transaction
17483
+ [paperclip] Scheduling attachments for deletion.
17484
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 6]]
17485
+ [paperclip] Deleting attachments.
17486
+  (0.0ms) commit transaction
17487
+  (0.0ms) begin transaction
17488
+ [paperclip] Scheduling attachments for deletion.
17489
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 7]]
17490
+ [paperclip] Deleting attachments.
17491
+ [paperclip] deleting public/system/books/5/assets/test_doc.jpg
17492
+  (0.1ms) commit transaction
17493
+  (0.0ms) begin transaction
17494
+ [paperclip] Scheduling attachments for deletion.
17495
+ SQL (0.3ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 8]]
17496
+ [paperclip] Deleting attachments.
17497
+ [paperclip] deleting public/system/books/6/assets/test_doc.jpg
17498
+  (5.4ms) commit transaction
17499
+ SQL (4.3ms) DELETE FROM "books_assets"
17500
+ SQL (5.0ms) DELETE FROM "books"
17501
+ SQL (6.1ms) DELETE FROM "books_assets"
17502
+ SQL (3.4ms) DELETE FROM "books"
17503
+  (0.1ms) begin transaction
17504
+ SQL (0.2ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17505
+  (6.2ms) commit transaction
17506
+  (0.1ms) begin transaction
17507
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 7
17508
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:00 UTC +00:00], ["book_id", 7], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17509
+ [paperclip] Saving attachments.
17510
+ [paperclip] saving public/system/books/7/assets/test_doc.jpg
17511
+  (4.4ms) commit transaction
17512
+ Processing by Books::AssetsController#index as HTML
17513
+ Parameters: {"book_id"=>"7", "type"=>"Assets/TestDoc"}
17514
+ Book Load (0.3ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "7"]]
17515
+ Books::Assets::TestDoc Load (0.3ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = '7'
17516
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = 7 LIMIT 1
17517
+ Completed 200 OK in 113ms (Views: 109.8ms | ActiveRecord: 0.8ms)
17518
+ SQL (3.4ms) DELETE FROM "books_assets"
17519
+ SQL (2.8ms) DELETE FROM "books"
17520
+  (0.1ms) begin transaction
17521
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17522
+  (2.6ms) commit transaction
17523
+ Processing by Books::AssetsController#index as HTML
17524
+ Parameters: {"book_id"=>"8", "type"=>"Assets/TestDoc"}
17525
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "8"]]
17526
+ Books::Assets::TestDoc Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = '8'
17527
+ Completed 200 OK in 4ms (Views: 0.9ms | ActiveRecord: 0.3ms)
17528
+ SQL (3.4ms) DELETE FROM "books_assets"
17529
+ SQL (4.2ms) DELETE FROM "books"
17530
+  (0.1ms) begin transaction
17531
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17532
+  (2.4ms) commit transaction
17533
+  (0.1ms) begin transaction
17534
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 9
17535
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:00 UTC +00:00], ["book_id", 9], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17536
+ [paperclip] Saving attachments.
17537
+ [paperclip] saving public/system/books/9/assets/test_doc.jpg
17538
+  (2.5ms) commit transaction
17539
+ Processing by Books::AssetsController#index as HTML
17540
+ Parameters: {"target"=>"target_div", "book_id"=>"9", "type"=>"Assets/TestDoc"}
17541
+ Book Load (0.1ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "9"]]
17542
+ Books::Assets::TestDoc Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = '9'
17543
+ Book Load (0.1ms) SELECT "books".* FROM "books" WHERE "books"."id" = 9 LIMIT 1
17544
+ Completed 200 OK in 8ms (Views: 5.8ms | ActiveRecord: 0.5ms)
17545
+ SQL (2.9ms) DELETE FROM "books_assets"
17546
+ SQL (2.3ms) DELETE FROM "books"
17547
+  (0.1ms) begin transaction
17548
+ SQL (0.2ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17549
+  (2.4ms) commit transaction
17550
+  (0.1ms) begin transaction
17551
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 10
17552
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:00 UTC +00:00], ["book_id", 10], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17553
+ [paperclip] Saving attachments.
17554
+ [paperclip] saving public/system/books/10/assets/test_doc.jpg
17555
+  (2.6ms) commit transaction
17556
+ Processing by Books::AssetsController#index as HTML
17557
+ Parameters: {"target"=>"target_div", "book_id"=>"10", "type"=>"Assets/TestDoc"}
17558
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "10"]]
17559
+ Books::Assets::TestDoc Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = '10'
17560
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = 10 LIMIT 1
17561
+ Completed 200 OK in 9ms (Views: 6.2ms | ActiveRecord: 0.5ms)
17562
+ SQL (2.7ms) DELETE FROM "books_assets"
17563
+ SQL (2.4ms) DELETE FROM "books"
17564
+  (0.1ms) begin transaction
17565
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17566
+  (2.2ms) commit transaction
17567
+  (0.1ms) begin transaction
17568
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 11
17569
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:00 UTC +00:00], ["book_id", 11], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17570
+ [paperclip] Saving attachments.
17571
+ [paperclip] saving public/system/books/11/assets/test_doc.jpg
17572
+  (2.6ms) commit transaction
17573
+ Processing by Books::AssetsController#index as HTML
17574
+ Parameters: {"target"=>"target_div", "book_id"=>"11", "type"=>"Assets/TestDoc"}
17575
+ Book Load (0.1ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "11"]]
17576
+ Books::Assets::TestDoc Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = '11'
17577
+ Book Load (0.1ms) SELECT "books".* FROM "books" WHERE "books"."id" = 11 LIMIT 1
17578
+ Completed 200 OK in 9ms (Views: 6.7ms | ActiveRecord: 0.5ms)
17579
+ SQL (31.6ms) DELETE FROM "books_assets"
17580
+ SQL (2.9ms) DELETE FROM "books"
17581
+  (0.1ms) begin transaction
17582
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17583
+  (3.4ms) commit transaction
17584
+  (0.1ms) begin transaction
17585
+  (0.3ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 12
17586
+ SQL (0.6ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:00 UTC +00:00], ["book_id", 12], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17587
+ [paperclip] Saving attachments.
17588
+ [paperclip] saving public/system/books/12/assets/test_doc.jpg
17589
+  (2.5ms) commit transaction
17590
+ Processing by Books::AssetsController#index as HTML
17591
+ Parameters: {"target"=>"target_div", "book_id"=>"12", "type"=>"Assets/TestDoc"}
17592
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "12"]]
17593
+ Books::Assets::TestDoc Load (0.3ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = '12'
17594
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = 12 LIMIT 1
17595
+ Completed 200 OK in 11ms (Views: 8.1ms | ActiveRecord: 0.7ms)
17596
+ SQL (2.6ms) DELETE FROM "books_assets"
17597
+ SQL (2.3ms) DELETE FROM "books"
17598
+  (0.1ms) begin transaction
17599
+ SQL (0.2ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17600
+  (4.2ms) commit transaction
17601
+  (0.1ms) begin transaction
17602
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 13
17603
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:00 UTC +00:00], ["book_id", 13], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17604
+ [paperclip] Saving attachments.
17605
+ [paperclip] saving public/system/books/13/assets/test_doc.jpg
17606
+  (2.6ms) commit transaction
17607
+ Processing by Books::AssetsController#index as JSON
17608
+ Parameters: {"target"=>"target_div", "book_id"=>"13", "type"=>"Assets/TestDoc"}
17609
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "13"]]
17610
+ Books::Assets::TestDoc Load (0.3ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = '13'
17611
+ Completed 200 OK in 5ms (Views: 2.0ms | ActiveRecord: 0.5ms)
17612
+ SQL (3.8ms) DELETE FROM "books_assets"
17613
+ SQL (3.9ms) DELETE FROM "books"
17614
+  (0.1ms) begin transaction
17615
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17616
+  (2.5ms) commit transaction
17617
+  (0.1ms) begin transaction
17618
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 14
17619
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:01 UTC +00:00], ["book_id", 14], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17620
+ [paperclip] Saving attachments.
17621
+ [paperclip] saving public/system/books/14/assets/test_doc.jpg
17622
+  (2.5ms) commit transaction
17623
+ Processing by Books::AssetsController#index as JSON
17624
+ Parameters: {"target"=>"target_div", "book_id"=>"14", "type"=>"Assets/TestDoc"}
17625
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "14"]]
17626
+ Books::Assets::TestDoc Load (0.3ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = '14'
17627
+ Completed 200 OK in 5ms (Views: 2.2ms | ActiveRecord: 0.6ms)
17628
+ SQL (2.7ms) DELETE FROM "books_assets"
17629
+ SQL (2.3ms) DELETE FROM "books"
17630
+  (0.1ms) begin transaction
17631
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17632
+  (2.2ms) commit transaction
17633
+ Processing by Books::AssetsController#create as JS
17634
+ Parameters: {"file"=>#<Rack::Test::UploadedFile:0x007fb850c9dde8 @content_type="image/jpeg", @original_filename="jpg_test.jpg", @tempfile=#<File:/var/folders/7g/mny7qppn6ds_prrh9nfvwz5w0000gn/T/jpg_test.jpg20120214-17861-mhfom4>>, "book_id"=>"15", "type"=>"Assets/TestDoc"}
17635
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "15"]]
17636
+  (0.1ms) begin transaction
17637
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 15
17638
+ SQL (0.5ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:01 UTC +00:00], ["book_id", 15], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17639
+ [paperclip] Saving attachments.
17640
+ [paperclip] saving public/system/books/15/assets/test_doc.jpg
17641
+  (2.4ms) commit transaction
17642
+ Completed 200 OK in 26ms (Views: 5.3ms | ActiveRecord: 3.5ms)
17643
+ SQL (3.3ms) DELETE FROM "books_assets"
17644
+ SQL (2.9ms) DELETE FROM "books"
17645
+  (0.1ms) begin transaction
17646
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17647
+  (2.9ms) commit transaction
17648
+ Processing by Books::AssetsController#create as JS
17649
+ Parameters: {"file"=>#<Rack::Test::UploadedFile:0x007fb852971870 @content_type="image/jpeg", @original_filename="jpg_test.jpg", @tempfile=#<File:/var/folders/7g/mny7qppn6ds_prrh9nfvwz5w0000gn/T/jpg_test.jpg20120214-17861-jy9kc4>>, "book_id"=>"16", "type"=>"Assets/TestDoc"}
17650
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "16"]]
17651
+  (0.2ms) begin transaction
17652
+  (0.3ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 16
17653
+ SQL (0.5ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:01 UTC +00:00], ["book_id", 16], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17654
+ [paperclip] Saving attachments.
17655
+ [paperclip] saving public/system/books/16/assets/test_doc.jpg
17656
+  (2.5ms) commit transaction
17657
+ Completed 200 OK in 89ms (Views: 0.7ms | ActiveRecord: 3.6ms)
17658
+ SQL (2.9ms) DELETE FROM "books_assets"
17659
+ SQL (3.6ms) DELETE FROM "books"
17660
+  (0.1ms) begin transaction
17661
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17662
+  (2.9ms) commit transaction
17663
+ Processing by Books::AssetsController#create as JS
17664
+ Parameters: {"file"=>#<Rack::Test::UploadedFile:0x007fb853cc2d20 @content_type="image/jpeg", @original_filename="jpg_test.jpg", @tempfile=#<File:/var/folders/7g/mny7qppn6ds_prrh9nfvwz5w0000gn/T/jpg_test.jpg20120214-17861-qm0sl5>>, "book_id"=>"17", "type"=>"Assets/TestDoc"}
17665
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "17"]]
17666
+  (0.1ms) begin transaction
17667
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 17
17668
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:01 UTC +00:00], ["book_id", 17], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17669
+ [paperclip] Saving attachments.
17670
+ [paperclip] saving public/system/books/17/assets/test_doc.jpg
17671
+  (2.6ms) commit transaction
17672
+ Completed 200 OK in 19ms (Views: 1.0ms | ActiveRecord: 3.5ms)
17673
+ SQL (3.9ms) DELETE FROM "books_assets"
17674
+ SQL (2.9ms) DELETE FROM "books"
17675
+  (0.1ms) begin transaction
17676
+ SQL (0.2ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17677
+  (4.6ms) commit transaction
17678
+  (0.1ms) begin transaction
17679
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 18
17680
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:01 UTC +00:00], ["book_id", 18], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17681
+ [paperclip] Saving attachments.
17682
+ [paperclip] saving public/system/books/18/assets/test_doc.jpg
17683
+  (3.6ms) commit transaction
17684
+ Processing by Books::AssetsController#destroy as JS
17685
+ Parameters: {"target"=>"target_div", "book_id"=>"18", "asset_id"=>"19"}
17686
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "18"]]
17687
+ Books::Asset Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."book_id" = 18 AND "books_assets"."id" = '19' LIMIT 1
17688
+  (0.0ms) begin transaction
17689
+ [paperclip] Scheduling attachments for deletion.
17690
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = 18 LIMIT 1
17691
+ SQL (0.4ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 19]]
17692
+ [paperclip] Deleting attachments.
17693
+ [paperclip] deleting public/system/books/18/assets/test_doc.jpg
17694
+  (2.6ms) commit transaction
17695
+ Completed 200 OK in 34ms (Views: 2.2ms | ActiveRecord: 3.6ms)
17696
+ SQL (2.7ms) DELETE FROM "books_assets"
17697
+ SQL (3.7ms) DELETE FROM "books"
17698
+  (0.1ms) begin transaction
17699
+ SQL (0.2ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17700
+  (2.4ms) commit transaction
17701
+  (0.1ms) begin transaction
17702
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 19
17703
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:01 UTC +00:00], ["book_id", 19], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17704
+ [paperclip] Saving attachments.
17705
+ [paperclip] saving public/system/books/19/assets/test_doc.jpg
17706
+  (4.2ms) commit transaction
17707
+ Processing by Books::AssetsController#destroy as JS
17708
+ Parameters: {"target"=>"target_div", "book_id"=>"19", "asset_id"=>"20"}
17709
+ Book Load (0.1ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "19"]]
17710
+ Books::Asset Load (0.3ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."book_id" = 19 AND "books_assets"."id" = '20' LIMIT 1
17711
+  (0.1ms) begin transaction
17712
+ [paperclip] Scheduling attachments for deletion.
17713
+ Book Load (0.2ms) SELECT "books".* FROM "books" WHERE "books"."id" = 19 LIMIT 1
17714
+ SQL (0.3ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 20]]
17715
+ [paperclip] Deleting attachments.
17716
+ [paperclip] deleting public/system/books/19/assets/test_doc.jpg
17717
+  (2.8ms) commit transaction
17718
+ Completed 200 OK in 15ms (Views: 0.8ms | ActiveRecord: 3.8ms)
17719
+ SQL (2.6ms) DELETE FROM "books_assets"
17720
+ SQL (4.1ms) DELETE FROM "books"
17721
+  (0.1ms) begin transaction
17722
+ SQL (0.2ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17723
+  (12.9ms) commit transaction
17724
+  (0.1ms) begin transaction
17725
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 20
17726
+ SQL (0.5ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:01 UTC +00:00], ["book_id", 20], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17727
+ [paperclip] Saving attachments.
17728
+ [paperclip] saving public/system/books/20/assets/test_doc.jpg
17729
+  (2.9ms) commit transaction
17730
+ Processing by Books::AssetsController#destroy as JS
17731
+ Parameters: {"target"=>"target_div", "book_id"=>"20", "asset_id"=>"21"}
17732
+ Book Load (0.1ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "20"]]
17733
+ Books::Asset Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."book_id" = 20 AND "books_assets"."id" = '21' LIMIT 1
17734
+  (0.0ms) begin transaction
17735
+ [paperclip] Scheduling attachments for deletion.
17736
+ Book Load (0.1ms) SELECT "books".* FROM "books" WHERE "books"."id" = 20 LIMIT 1
17737
+ SQL (0.3ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 21]]
17738
+ [paperclip] Deleting attachments.
17739
+ [paperclip] deleting public/system/books/20/assets/test_doc.jpg
17740
+  (4.4ms) commit transaction
17741
+ Completed 200 OK in 14ms (Views: 0.9ms | ActiveRecord: 5.1ms)
17742
+ SQL (6.0ms) DELETE FROM "books_assets"
17743
+ SQL (3.3ms) DELETE FROM "books"
17744
+  (0.1ms) begin transaction
17745
+ SQL (0.2ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17746
+  (3.5ms) commit transaction
17747
+  (0.1ms) begin transaction
17748
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 21
17749
+ SQL (0.4ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", "image/jpeg"], ["asset_file_name", "jpg_test.jpg"], ["asset_file_size", 5267], ["asset_updated_at", Tue, 14 Feb 2012 14:16:01 UTC +00:00], ["book_id", 21], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17750
+ [paperclip] Saving attachments.
17751
+ [paperclip] saving public/system/books/21/assets/test_doc.jpg
17752
+  (3.2ms) commit transaction
17753
+ Processing by Books::AssetsController#destroy as JS
17754
+ Parameters: {"target"=>"target_div", "book_id"=>"21", "asset_id"=>"22"}
17755
+ Book Load (0.1ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", "21"]]
17756
+ Books::Asset Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."book_id" = 21 AND "books_assets"."id" = '22' LIMIT 1
17757
+  (0.1ms) begin transaction
17758
+ [paperclip] Scheduling attachments for deletion.
17759
+ Book Load (0.1ms) SELECT "books".* FROM "books" WHERE "books"."id" = 21 LIMIT 1
17760
+ SQL (0.4ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 22]]
17761
+ [paperclip] Deleting attachments.
17762
+ [paperclip] deleting public/system/books/21/assets/test_doc.jpg
17763
+  (3.7ms) commit transaction
17764
+ Completed 200 OK in 14ms (Views: 0.8ms | ActiveRecord: 4.7ms)
17765
+  (0.1ms) begin transaction
17766
+ [paperclip] Scheduling attachments for deletion.
17767
+ SQL (0.3ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 9]]
17768
+ [paperclip] Deleting attachments.
17769
+ [paperclip] deleting public/system/books/7/assets/test_doc.jpg
17770
+  (0.1ms) commit transaction
17771
+  (0.0ms) begin transaction
17772
+ [paperclip] Scheduling attachments for deletion.
17773
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 10]]
17774
+ [paperclip] Deleting attachments.
17775
+ [paperclip] deleting public/system/books/9/assets/test_doc.jpg
17776
+  (0.0ms) commit transaction
17777
+  (0.1ms) begin transaction
17778
+ [paperclip] Scheduling attachments for deletion.
17779
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 11]]
17780
+ [paperclip] Deleting attachments.
17781
+ [paperclip] deleting public/system/books/10/assets/test_doc.jpg
17782
+  (0.1ms) commit transaction
17783
+  (0.0ms) begin transaction
17784
+ [paperclip] Scheduling attachments for deletion.
17785
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 12]]
17786
+ [paperclip] Deleting attachments.
17787
+ [paperclip] deleting public/system/books/11/assets/test_doc.jpg
17788
+  (0.1ms) commit transaction
17789
+  (0.0ms) begin transaction
17790
+ [paperclip] Scheduling attachments for deletion.
17791
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 13]]
17792
+ [paperclip] Deleting attachments.
17793
+ [paperclip] deleting public/system/books/12/assets/test_doc.jpg
17794
+  (0.1ms) commit transaction
17795
+  (0.0ms) begin transaction
17796
+ [paperclip] Scheduling attachments for deletion.
17797
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 14]]
17798
+ [paperclip] Deleting attachments.
17799
+ [paperclip] deleting public/system/books/13/assets/test_doc.jpg
17800
+  (0.1ms) commit transaction
17801
+  (0.0ms) begin transaction
17802
+ [paperclip] Scheduling attachments for deletion.
17803
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 15]]
17804
+ [paperclip] Deleting attachments.
17805
+ [paperclip] deleting public/system/books/14/assets/test_doc.jpg
17806
+  (0.1ms) commit transaction
17807
+  (0.0ms) begin transaction
17808
+ [paperclip] Scheduling attachments for deletion.
17809
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 16]]
17810
+ [paperclip] Deleting attachments.
17811
+ [paperclip] deleting public/system/books/15/assets/test_doc.jpg
17812
+  (0.1ms) commit transaction
17813
+  (0.0ms) begin transaction
17814
+ [paperclip] Scheduling attachments for deletion.
17815
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 17]]
17816
+ [paperclip] Deleting attachments.
17817
+ [paperclip] deleting public/system/books/16/assets/test_doc.jpg
17818
+  (0.1ms) commit transaction
17819
+  (0.0ms) begin transaction
17820
+ [paperclip] Scheduling attachments for deletion.
17821
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 18]]
17822
+ [paperclip] Deleting attachments.
17823
+ [paperclip] deleting public/system/books/17/assets/test_doc.jpg
17824
+  (0.1ms) commit transaction
17825
+  (0.0ms) begin transaction
17826
+ [paperclip] Scheduling attachments for deletion.
17827
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 19]]
17828
+ [paperclip] Deleting attachments.
17829
+  (0.1ms) commit transaction
17830
+  (0.0ms) begin transaction
17831
+ [paperclip] Scheduling attachments for deletion.
17832
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 20]]
17833
+ [paperclip] Deleting attachments.
17834
+  (0.1ms) commit transaction
17835
+  (0.0ms) begin transaction
17836
+ [paperclip] Scheduling attachments for deletion.
17837
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 21]]
17838
+ [paperclip] Deleting attachments.
17839
+  (0.1ms) commit transaction
17840
+  (0.0ms) begin transaction
17841
+ [paperclip] Scheduling attachments for deletion.
17842
+ SQL (0.1ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 22]]
17843
+ [paperclip] Deleting attachments.
17844
+  (0.1ms) commit transaction
17845
+ SQL (2.8ms) DELETE FROM "books_assets"
17846
+ SQL (2.4ms) DELETE FROM "books"
17847
+ SQL (2.8ms) DELETE FROM "books_assets"
17848
+ SQL (2.4ms) DELETE FROM "books"
17849
+ SQL (4.2ms) DELETE FROM "books_assets"
17850
+ SQL (3.8ms) DELETE FROM "books"
17851
+ SQL (4.6ms) DELETE FROM "books_assets"
17852
+ SQL (3.0ms) DELETE FROM "books"
17853
+ SQL (2.8ms) DELETE FROM "books_assets"
17854
+ SQL (4.0ms) DELETE FROM "books"
17855
+ SQL (2.9ms) DELETE FROM "books_assets"
17856
+ SQL (3.3ms) DELETE FROM "books"
17857
+ SQL (3.7ms) DELETE FROM "books_assets"
17858
+ SQL (4.8ms) DELETE FROM "books"
17859
+ SQL (4.7ms) DELETE FROM "books_assets"
17860
+ SQL (3.2ms) DELETE FROM "books"
17861
+ SQL (4.2ms) DELETE FROM "books_assets"
17862
+ SQL (3.0ms) DELETE FROM "books"
17863
+  (0.1ms) begin transaction
17864
+ SQL (0.2ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17865
+  (4.3ms) commit transaction
17866
+  (0.1ms) begin transaction
17867
+ Books::Assets::UniqueTestDoc Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::UniqueTestDoc') AND "books_assets"."book_id" = 22 LIMIT 1
17868
+  (0.1ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::UniqueTestDoc') AND "books_assets"."book_id" = 22
17869
+ SQL (0.3ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", nil], ["asset_file_name", nil], ["asset_file_size", nil], ["asset_updated_at", nil], ["book_id", 22], ["counter", 1], ["type", "Books::Assets::UniqueTestDoc"]]
17870
+ [paperclip] Saving attachments.
17871
+  (3.3ms) commit transaction
17872
+  (0.1ms) begin transaction
17873
+ Books::Assets::UniqueTestDoc Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::UniqueTestDoc') AND "books_assets"."book_id" = 22 LIMIT 1
17874
+  (0.1ms) rollback transaction
17875
+ Books::Assets::UniqueTestDoc Load (0.2ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::UniqueTestDoc') AND "books_assets"."book_id" = 22 LIMIT 1
17876
+ Books::Assets::UniqueTestDoc Load (0.1ms) SELECT "books_assets".* FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::UniqueTestDoc') AND "books_assets"."book_id" = 22 LIMIT 1
17877
+ SQL (4.4ms) DELETE FROM "books_assets"
17878
+ SQL (4.4ms) DELETE FROM "books"
17879
+  (0.1ms) begin transaction
17880
+ SQL (0.3ms) INSERT INTO "books" ("title") VALUES (?) [["title", "my new book"]]
17881
+  (4.4ms) commit transaction
17882
+  (0.0ms) begin transaction
17883
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 23
17884
+ SQL (0.3ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", nil], ["asset_file_name", nil], ["asset_file_size", nil], ["asset_updated_at", nil], ["book_id", 23], ["counter", 1], ["type", "Books::Assets::TestDoc"]]
17885
+ [paperclip] Saving attachments.
17886
+  (2.5ms) commit transaction
17887
+  (0.1ms) begin transaction
17888
+  (0.2ms) SELECT MAX("books_assets"."counter") AS max_id FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."book_id" = 23
17889
+ SQL (0.3ms) INSERT INTO "books_assets" ("asset_content_type", "asset_file_name", "asset_file_size", "asset_updated_at", "book_id", "counter", "type") VALUES (?, ?, ?, ?, ?, ?, ?) [["asset_content_type", nil], ["asset_file_name", nil], ["asset_file_size", nil], ["asset_updated_at", nil], ["book_id", 23], ["counter", 2], ["type", "Books::Assets::TestDoc"]]
17890
+ [paperclip] Saving attachments.
17891
+  (3.8ms) commit transaction
17892
+  (0.1ms) begin transaction
17893
+ [paperclip] Scheduling attachments for deletion.
17894
+ SQL (0.2ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::UniqueTestDoc') AND "books_assets"."id" = ? [["id", 23]]
17895
+ [paperclip] Deleting attachments.
17896
+  (0.1ms) commit transaction
17897
+  (0.0ms) begin transaction
17898
+ [paperclip] Scheduling attachments for deletion.
17899
+ [paperclip] Deleting attachments.
17900
+  (0.0ms) commit transaction
17901
+  (0.0ms) begin transaction
17902
+ [paperclip] Scheduling attachments for deletion.
17903
+ SQL (0.3ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 24]]
17904
+ [paperclip] Deleting attachments.
17905
+  (5.8ms) commit transaction
17906
+  (0.0ms) begin transaction
17907
+ [paperclip] Scheduling attachments for deletion.
17908
+ SQL (0.2ms) DELETE FROM "books_assets" WHERE "books_assets"."type" IN ('Books::Assets::TestDoc') AND "books_assets"."id" = ? [["id", 25]]
17909
+ [paperclip] Deleting attachments.
17910
+  (2.9ms) commit transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-14 00:00:00.000000000Z
12
+ date: 2012-02-15 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70319499869720 !ruby/object:Gem::Requirement
16
+ requirement: &70093618686820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70319499869720
24
+ version_requirements: *70093618686820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: paperclip
27
- requirement: &70319499869300 !ruby/object:Gem::Requirement
27
+ requirement: &70093618686400 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70319499869300
35
+ version_requirements: *70093618686400
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sqlite3
38
- requirement: &70319499868840 !ruby/object:Gem::Requirement
38
+ requirement: &70093618685940 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70319499868840
46
+ version_requirements: *70093618685940
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec-rails
49
- requirement: &70319499868420 !ruby/object:Gem::Requirement
49
+ requirement: &70093618685520 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70319499868420
57
+ version_requirements: *70093618685520
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: paperclip
60
- requirement: &70319499868000 !ruby/object:Gem::Requirement
60
+ requirement: &70093618685100 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70319499868000
68
+ version_requirements: *70093618685100
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: shoulda-matchers
71
- requirement: &70319499867580 !ruby/object:Gem::Requirement
71
+ requirement: &70093618684680 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70319499867580
79
+ version_requirements: *70093618684680
80
80
  description: ''
81
81
  email:
82
82
  - acampolonghi@gmail.com
@@ -125,6 +125,7 @@ files:
125
125
  - spec/dummy/config/routes.rb
126
126
  - spec/dummy/config.ru
127
127
  - spec/dummy/db/development.sqlite3
128
+ - spec/dummy/db/test.sqlite3
128
129
  - spec/dummy/log/development.log
129
130
  - spec/dummy/log/test.log
130
131
  - spec/dummy/public/404.html
@@ -158,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
158
159
  version: '0'
159
160
  segments:
160
161
  - 0
161
- hash: 917527614412971072
162
+ hash: -463942544642964676
162
163
  required_rubygems_version: !ruby/object:Gem::Requirement
163
164
  none: false
164
165
  requirements:
@@ -167,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
168
  version: '0'
168
169
  segments:
169
170
  - 0
170
- hash: 917527614412971072
171
+ hash: -463942544642964676
171
172
  requirements: []
172
173
  rubyforge_project:
173
174
  rubygems_version: 1.8.10
@@ -199,6 +200,7 @@ test_files:
199
200
  - spec/dummy/config/routes.rb
200
201
  - spec/dummy/config.ru
201
202
  - spec/dummy/db/development.sqlite3
203
+ - spec/dummy/db/test.sqlite3
202
204
  - spec/dummy/log/development.log
203
205
  - spec/dummy/log/test.log
204
206
  - spec/dummy/public/404.html