Commit 41d7fdea by jyurek

Fixed errors on delete and some nil errors.

git-svn-id: https://svn.thoughtbot.com/plugins/paperclip/trunk@170 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
parent 1aa717f2
...@@ -50,12 +50,12 @@ module Thoughtbot ...@@ -50,12 +50,12 @@ module Thoughtbot
define_method "#{attr}_filename" do |*args| define_method "#{attr}_filename" do |*args|
style = args.shift || :original # This prevents arity warnings style = args.shift || :original # This prevents arity warnings
path_for attachments[attr], style self["#{attr}_file_name"] ? path_for(attachments[attr], style) : ""
end end
define_method "#{attr}_url" do |*args| define_method "#{attr}_url" do |*args|
style = args.shift || :original # This prevents arity warnings style = args.shift || :original # This prevents arity warnings
url_for attachments[attr], style self["#{attr}_file_name"] ? url_for(attachments[attr], style) : ""
end end
define_method "#{attr}_valid?" do define_method "#{attr}_valid?" do
...@@ -103,7 +103,7 @@ module Thoughtbot ...@@ -103,7 +103,7 @@ module Thoughtbot
prefix.gsub!(/:id/, self.id.to_s) if self.id prefix.gsub!(/:id/, self.id.to_s) if self.id
prefix.gsub!(/:class/, self.class.to_s.underscore) prefix.gsub!(/:class/, self.class.to_s.underscore)
prefix.gsub!(/:style/, style.to_s) prefix.gsub!(/:style/, style.to_s)
File.join( prefix.split("/"), read_attribute("#{attachment[:name]}_file_name") ) File.join( prefix.split("/"), read_attribute("#{attachment[:name]}_file_name").to_s )
end end
def url_for attachment, style = :original def url_for attachment, style = :original
...@@ -112,7 +112,7 @@ module Thoughtbot ...@@ -112,7 +112,7 @@ module Thoughtbot
prefix.gsub!(/:id/, self.id.to_s) if self.id prefix.gsub!(/:id/, self.id.to_s) if self.id
prefix.gsub!(/:class/, self.class.to_s.underscore) prefix.gsub!(/:class/, self.class.to_s.underscore)
prefix.gsub!(/:style/, style.to_s) prefix.gsub!(/:style/, style.to_s)
File.join( prefix.split("/"), read_attribute("#{attachment[:name]}_file_name") ) File.join( prefix.split("/"), read_attribute("#{attachment[:name]}_file_name").to_s )
end end
def ensure_directories_for attachment def ensure_directories_for attachment
...@@ -135,7 +135,11 @@ module Thoughtbot ...@@ -135,7 +135,11 @@ module Thoughtbot
def delete_attachment attachment def delete_attachment attachment
(attachment[:thumbnails].keys + [:original]).each do |style| (attachment[:thumbnails].keys + [:original]).each do |style|
file_path = path_for(attachment, style) file_path = path_for(attachment, style)
begin
FileUtils.rm(file_path) FileUtils.rm(file_path)
rescue Errno::ENOENT
raise if ::Thoughtbot::Paperclip.whiny_deletes?
end
end end
self.update_attribute "#{attachment[:name]}_file_name", nil self.update_attribute "#{attachment[:name]}_file_name", nil
self.update_attribute "#{attachment[:name]}_content_type", nil self.update_attribute "#{attachment[:name]}_content_type", nil
...@@ -182,6 +186,10 @@ module Thoughtbot ...@@ -182,6 +186,10 @@ module Thoughtbot
File.size(self) File.size(self)
end end
end end
def self.whiny_deletes?
false
end
end end
end end
......
# Logfile created on Fri Aug 17 16:35:53 -0400 2007 by logger.rb/1.5.2.9
SQL (0.002457) CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.002028) CREATE TABLE bars ("id" INTEGER PRIMARY KEY NOT NULL, "document_file_name" varchar(255) DEFAULT NULL, "document_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000412) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000351) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000345) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000515) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000423) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000420) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000525) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000462) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000416) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000514) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000418) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000507) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000543) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000475) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000428) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000478) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000463) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000496) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000526) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.082546) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000442) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000485) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000463) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000458) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000527) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.050784)  DELETE FROM foos
WHERE id = 13

SQL (0.000507) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000509) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000484) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000460) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000516) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000526) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.298404)  DELETE FROM foos
WHERE id = 15

SQL (0.000432) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000431) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000477) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000462) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000529) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000537) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.044000)  DELETE FROM foos
WHERE id = 17

SQL (0.000468) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000428) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000493) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000465) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000462) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000540) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.046513)  DELETE FROM foos
WHERE id = 19

SQL (0.000453) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000526) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000503) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000442) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000537) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000529) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.000486)  DELETE FROM foos
WHERE id = 21

SQL (0.000460) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000486) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000483) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000507) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000743) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000522) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.000563)  DELETE FROM foos
WHERE id = 23

SQL (0.000464) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000474) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000615) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000462) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000625) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000553) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.000541)  DELETE FROM foos
WHERE id = 25

SQL (0.000469) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000481) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000483) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.001317) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000687) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000543) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.050704) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000504) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000537) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.000548)  DELETE FROM foos
WHERE id = 27

SQL (0.000519) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000486) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000470) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000438) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000555) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000535) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.000491)  DELETE FROM foos
WHERE id = 29

SQL (0.000496) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000474) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000469) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000582) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000608) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000553) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.042183)  DELETE FROM foos
WHERE id = 31

SQL (0.000474) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000481) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000544) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000486) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000439) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000617) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.054972)  DELETE FROM foos
WHERE id = 33

SQL (0.000476) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000496) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000489) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000475) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000450) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000528) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
Foo Destroy (0.000650)  DELETE FROM foos
WHERE id = 35

SQL (0.000493) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000420) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000491) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000440) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000526) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000706) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000511)  DELETE FROM foos
WHERE id = 37

SQL (0.000661) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000684) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000493) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000403)  DELETE FROM bars
WHERE id = 52

SQL (0.000437) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000437) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000614) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000392)  DELETE FROM foos
WHERE id = 39

SQL (0.000620) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000664) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000510) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000395)  DELETE FROM bars
WHERE id = 54

SQL (0.000439) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000464) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000611) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000396)  DELETE FROM foos
WHERE id = 41

SQL (0.000483) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000488) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000527) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000419)  DELETE FROM bars
WHERE id = 56

SQL (0.000432) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000477) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000615) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000379)  DELETE FROM foos
WHERE id = 43

SQL (0.000514) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000546) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000561) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000663)  DELETE FROM bars
WHERE id = 58

SQL (0.000438) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.001249) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000613) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000425)  DELETE FROM foos
WHERE id = 45

SQL (0.000487) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000479) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000538) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000423)  DELETE FROM bars
WHERE id = 60

SQL (0.000479) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000466) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000733) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000427)  DELETE FROM foos
WHERE id = 47

SQL (0.000486) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000491) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000555) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000973)  DELETE FROM bars
WHERE id = 62

SQL (0.000441) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000404) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000660) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000424)  DELETE FROM foos
WHERE id = 49

SQL (0.000480) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000480) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000937) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000428)  DELETE FROM bars
WHERE id = 64

SQL (0.000440) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000505) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000613) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000489)  DELETE FROM foos
WHERE id = 51

SQL (0.000509) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000535) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000555) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000473)  DELETE FROM bars
WHERE id = 66

SQL (0.000443) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000466) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000622) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000442)  DELETE FROM foos
WHERE id = 53

SQL (0.000545) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000511) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000494) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000468)  DELETE FROM bars
WHERE id = 68

SQL (0.000446) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000499) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000614) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000408)  DELETE FROM foos
WHERE id = 55

SQL (0.000499) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000491) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000542) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000664)  DELETE FROM bars
WHERE id = 70

SQL (0.000438) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000451) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000632) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000483)  DELETE FROM foos
WHERE id = 57

SQL (0.000544) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000510) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.001524) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000438)  DELETE FROM bars
WHERE id = 72

SQL (0.000444) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000491) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000622) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Update (0.000477) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 59
Foo Update (0.000100) UPDATE foos SET "image_content_type" = NULL, "image_file_name" = NULL WHERE id = 59
Foo Destroy (0.000082)  DELETE FROM foos
WHERE id = 59

SQL (0.000522) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000491) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000564) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Update (0.000493) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 74
Bar Update (0.000162) UPDATE bars SET "document_content_type" = NULL, "document_file_name" = NULL WHERE id = 74
Bar Destroy (0.000092)  DELETE FROM bars
WHERE id = 74

SQL (0.000511) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000523) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000627) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Update (0.000475) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 61
Foo Update (0.000095) UPDATE foos SET "image_content_type" = NULL, "image_file_name" = NULL WHERE id = 61
Foo Destroy (0.000084)  DELETE FROM foos
WHERE id = 61

SQL (0.000495) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000493) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000623) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Update (0.000507) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 76
Bar Update (0.000154) UPDATE bars SET "document_content_type" = NULL, "document_file_name" = NULL WHERE id = 76
Bar Destroy (0.000223)  DELETE FROM bars
WHERE id = 76

SQL (0.000501) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000468) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000644) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Update (0.000469) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 63
Foo Update (0.000097) UPDATE foos SET "image_content_type" = NULL, "image_file_name" = NULL WHERE id = 63
Foo Destroy (0.000076)  DELETE FROM foos
WHERE id = 63

SQL (0.000494) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000497) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000540) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Update (0.000453) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 78
Bar Update (0.000120) UPDATE bars SET "document_content_type" = NULL, "document_file_name" = NULL WHERE id = 78
Bar Destroy (0.000077)  DELETE FROM bars
WHERE id = 78

SQL (0.000485) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000592) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000622) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Update (0.000451) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 65
Foo Update (0.000098) UPDATE foos SET "image_content_type" = NULL, "image_file_name" = NULL WHERE id = 65
Foo Destroy (0.000075)  DELETE FROM foos
WHERE id = 65

SQL (0.000487) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000495) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000533) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Update (0.000450) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 80
Bar Update (0.000100) UPDATE bars SET "document_content_type" = NULL, "document_file_name" = NULL WHERE id = 80
Bar Destroy (0.000192)  DELETE FROM bars
WHERE id = 80

SQL (0.000495) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000629) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000612) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Update (0.000446) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 67
Foo Update (0.000090) UPDATE foos SET "image_content_type" = NULL, "image_file_name" = NULL WHERE id = 67
Foo Destroy (0.000074)  DELETE FROM foos
WHERE id = 67

SQL (0.000492) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000504) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000520) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Update (0.000508) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 82
Bar Update (0.000125) UPDATE bars SET "document_content_type" = NULL, "document_file_name" = NULL WHERE id = 82
Bar Destroy (0.000238)  DELETE FROM bars
WHERE id = 82

SQL (0.000554) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000495) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000631) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Update (0.000449) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 69
Foo Update (0.000092) UPDATE foos SET "image_content_type" = NULL, "image_file_name" = NULL WHERE id = 69
Foo Destroy (0.000189)  DELETE FROM foos
WHERE id = 69

SQL (0.000500) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000519) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000508) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000497) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000418) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000629) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Update (0.000449) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 71
Foo Update (0.000095) UPDATE foos SET "image_content_type" = NULL, "image_file_name" = NULL WHERE id = 71
Foo Destroy (0.000077)  DELETE FROM foos
WHERE id = 71

SQL (0.000494) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000494) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000539) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Update (0.000552) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 87
Bar Update (0.000175) UPDATE bars SET "document_content_type" = NULL, "document_file_name" = NULL WHERE id = 87
Bar Destroy (0.000214)  DELETE FROM bars
WHERE id = 87

SQL (0.000500) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000510) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000000) SQLite3::SQLException: table foos already exists: CREATE TABLE foos ("id" INTEGER PRIMARY KEY NOT NULL, "image_file_name" varchar(255) DEFAULT NULL, "image_content_type" varchar(255) DEFAULT NULL) 
SQL (0.000638) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Update (0.000456) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 73
Foo Update (0.000096) UPDATE foos SET "image_content_type" = NULL, "image_file_name" = NULL WHERE id = 73
Foo Destroy (0.000085)  DELETE FROM foos
WHERE id = 73

SQL (0.000626) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000659) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000547) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Update (0.000459) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 89
Bar Update (0.000106) UPDATE bars SET "document_content_type" = NULL, "document_file_name" = NULL WHERE id = 89
Bar Destroy (0.000080)  DELETE FROM bars
WHERE id = 89

SQL (0.000476) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000491) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment