Commit 1aa717f2 by jyurek

Fixed up some issues regarding file names and deleting attachments.

git-svn-id: https://svn.thoughtbot.com/plugins/paperclip/trunk@169 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
parent 163c11de
...@@ -21,6 +21,7 @@ module Thoughtbot ...@@ -21,6 +21,7 @@ module Thoughtbot
attachments[attr] = (attachments[attr] || {:name => attr}).merge(options) attachments[attr] = (attachments[attr] || {:name => attr}).merge(options)
define_method "#{attr}=" do |uploaded_file| define_method "#{attr}=" do |uploaded_file|
return unless is_a_file? uploaded_file
attachments[attr].merge!({ attachments[attr].merge!({
:dirty => true, :dirty => true,
:files => {:original => uploaded_file}, :files => {:original => uploaded_file},
...@@ -39,6 +40,10 @@ module Thoughtbot ...@@ -39,6 +40,10 @@ module Thoughtbot
uploaded_file uploaded_file
end end
define_method attr do
self.send("#{attr}_file_name")
end
define_method "#{attr}_attachment" do define_method "#{attr}_attachment" do
attachments[attr] attachments[attr]
end end
...@@ -61,9 +66,15 @@ module Thoughtbot ...@@ -61,9 +66,15 @@ module Thoughtbot
end end
end end
define_method "destroy_#{attr}" do
if attachments[attr].keys.any?
delete_attachment attachments[attr]
end
end
define_method "#{attr}_after_save" do define_method "#{attr}_after_save" do
if attachments[attr].keys.any? if attachments[attr].keys.any?
write_attachment attachments[attr] write_attachment attachments[attr] if attachments[attr][:files]
attachments[attr][:dirty] = false attachments[attr][:dirty] = false
attachments[attr][:files] = nil attachments[attr][:files] = nil
end end
...@@ -84,6 +95,8 @@ module Thoughtbot ...@@ -84,6 +95,8 @@ module Thoughtbot
module InstanceMethods module InstanceMethods
private
def path_for attachment, style = :original def path_for attachment, style = :original
prefix = File.join(attachment[:path_prefix], attachment[:path]) prefix = File.join(attachment[:path_prefix], attachment[:path])
prefix.gsub!(/:rails_root/, RAILS_ROOT) prefix.gsub!(/:rails_root/, RAILS_ROOT)
...@@ -103,7 +116,7 @@ module Thoughtbot ...@@ -103,7 +116,7 @@ module Thoughtbot
end end
def ensure_directories_for attachment def ensure_directories_for attachment
attachment[:files].keys.each do |style| attachment[:files].each do |style, file|
dirname = File.dirname(path_for(attachment, style)) dirname = File.dirname(path_for(attachment, style))
FileUtils.mkdir_p dirname FileUtils.mkdir_p dirname
end end
...@@ -121,12 +134,15 @@ module Thoughtbot ...@@ -121,12 +134,15 @@ module Thoughtbot
def delete_attachment attachment def delete_attachment attachment
(attachment[:thumbnails].keys + [:original]).each do |style| (attachment[:thumbnails].keys + [:original]).each do |style|
FileUtils.rm path_for(attachment, style) file_path = path_for(attachment, style)
FileUtils.rm(file_path)
end end
self.update_attribute "#{attachment[:name]}_file_name", nil
self.update_attribute "#{attachment[:name]}_content_type", nil
end end
def make_thumbnail orig_io, geometry def make_thumbnail orig_io, geometry
thumb = IO.popen("convert - -scale '#{geometry}' - > /dev/stdout", "w+") do |io| thumb = IO.popen("convert - -scale '#{geometry}' -", "w+") do |io|
orig_io.rewind orig_io.rewind
io.write(orig_io.read) io.write(orig_io.read)
io.close_write io.close_write
...@@ -136,6 +152,12 @@ module Thoughtbot ...@@ -136,6 +152,12 @@ module Thoughtbot
StringIO.new(thumb) StringIO.new(thumb)
end end
def is_a_file? data
[:size, :content_type, :original_filename].map do |meth|
data.respond_to? meth
end.all?
end
def sanitize_filename filename def sanitize_filename filename
File.basename(filename).gsub(/[^\w\.\_]/,'_') File.basename(filename).gsub(/[^\w\.\_]/,'_')
end end
...@@ -155,6 +177,10 @@ module Thoughtbot ...@@ -155,6 +177,10 @@ module Thoughtbot
def original_filename def original_filename
self.path self.path
end end
def size
File.size(self)
end
end end
end end
end end
......
# Logfile created on Sat Aug 04 20:42:44 -0400 2007 by logger.rb/1.5.2.9 # Logfile created on Fri Aug 17 16:35:53 -0400 2007 by logger.rb/1.5.2.9
SQL (0.004173) 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.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.002037) 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.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.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.000412) INSERT INTO foos ("image_content_type", "image_file_name") 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.000351) INSERT INTO foos ("image_content_type", "image_file_name") 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.000345) INSERT INTO foos ("image_content_type", "image_file_name") 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.000515) 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.000423) 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.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.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.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.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.000462) INSERT INTO foos ("image_content_type", "image_file_name") 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.000416) INSERT INTO foos ("image_content_type", "image_file_name") 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.000514) 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.000418) 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.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.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.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.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.000475) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000588) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000428) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000491) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000478) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000494) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000463) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000351) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') 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.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.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.000581) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.082546) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000470) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000442) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000505) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000485) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000364) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000463) 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.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.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.000587) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000527) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000574) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') Foo Destroy (0.050784)  DELETE FROM foos
SQL (0.000485) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') WHERE id = 13
SQL (0.000359) 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.000507) INSERT INTO foos ("image_content_type", "image_file_name") 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.000509) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000597) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000484) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000605) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000460) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000443) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000516) 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('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.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.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)  Foo Destroy (0.298404)  DELETE FROM foos
SQL (0.000646) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') WHERE id = 15
SQL (0.000463) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') 
SQL (0.000473) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000432) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000459) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000431) INSERT INTO foos ("image_content_type", "image_file_name") 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.000477) 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.000462) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.062484) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000529) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000505) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') 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.000499) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000537) 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('test_document.doc', 'application/doc') Foo Destroy (0.044000)  DELETE FROM foos
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)  WHERE id = 17
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.000594) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000468) 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('image/jpg', 'test_image.jpg') SQL (0.000428) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000506) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000493) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000477) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000465) 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.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.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.000602) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000540) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000608) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') Foo Destroy (0.046513)  DELETE FROM foos
SQL (0.000495) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') WHERE id = 19
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.000453) INSERT INTO foos ("image_content_type", "image_file_name") 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.000588) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000503) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000483) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000442) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000403) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000537) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000394) 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.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')
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)  Foo Destroy (0.000486)  DELETE FROM foos
SQL (0.000618) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') WHERE id = 21
SQL (0.000560) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') 
SQL (0.000397) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000460) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000629) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000486) INSERT INTO foos ("image_content_type", "image_file_name") 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.000483) 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.000507) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000589) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000743) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000476) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') 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.000511) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000522) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000523) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') Foo Destroy (0.000563)  DELETE FROM foos
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)  WHERE id = 23
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.000669) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000464) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000473) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000474) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000487) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000615) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('NULL', 'NULL')
SQL (0.000415) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') 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.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.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.000582) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000553) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('NULL', 'NULL')
SQL (0.000470) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') Foo Destroy (0.000541)  DELETE FROM foos
SQL (0.000469) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') WHERE id = 25
SQL (0.000465) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') 
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.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') SQL (0.000614) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000539) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') Foo Destroy (0.000392)  DELETE FROM foos
SQL (0.000489) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') WHERE id = 39
SQL (0.000457) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') 
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.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') SQL (0.000611) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000500) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') Foo Destroy (0.000396)  DELETE FROM foos
SQL (0.000490) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') WHERE id = 41
SQL (0.000515) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') 
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.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.000608) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000615) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000549) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') Foo Destroy (0.000379)  DELETE FROM foos
SQL (0.000554) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') WHERE id = 43
SQL (0.000523) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') 
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.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.000678) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') 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.000479) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000570) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000538) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000462) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') Bar Destroy (0.000423)  DELETE FROM bars
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)  WHERE id = 60
SQL (0.000577) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') 
SQL (0.000489) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000479) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000544) 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.000438) 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.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.000619) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000733) 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') Foo Destroy (0.000427)  DELETE FROM foos
SQL (0.000508) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') WHERE id = 47
SQL (0.000469) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') 
SQL (0.002361) 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.000486) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.002155) 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.000491) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000407) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000555) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000420) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') Bar Destroy (0.000973)  DELETE FROM bars
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)  WHERE id = 62
SQL (0.000517) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') 
SQL (0.000501) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000441) 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.000404) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000737) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000458) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000489) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000689) 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.000813) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000473) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000498) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000435) 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.000590) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000474) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000558) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000408) 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.000605) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000470) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000509) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000568) 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.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') SQL (0.000660) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000484) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') Foo Destroy (0.000424)  DELETE FROM foos
SQL (0.000446) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') WHERE id = 49
SQL (0.000436) 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.000593) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000470) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000553) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000427) 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.000598) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000476) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000498) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000381) 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.000596) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000520) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000550) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000454) 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.000602) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000473) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000607) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000410) 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.000624) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000512) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000501) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.001001) 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.000645) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000492) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000604) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000516) 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.000736) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000514) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000613) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000456) 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.000610) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000471) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000563) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000414)  DELETE FROM bars
WHERE id = 19
 
SQL (0.000397) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000480) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000565) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') 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.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.000633) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000613) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000514)  DELETE FROM foos Foo Destroy (0.000489)  DELETE FROM foos
WHERE id = 19 WHERE id = 51
 
SQL (0.000553) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000509) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000527) 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.000546) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000555) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000413)  DELETE FROM bars Bar Destroy (0.000473)  DELETE FROM bars
WHERE id = 21 WHERE id = 66
 
SQL (0.000414) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000443) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000445) 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.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.000673) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000622) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000450)  DELETE FROM foos Foo Destroy (0.000442)  DELETE FROM foos
WHERE id = 21 WHERE id = 53
 
SQL (0.000495) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000545) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000521) 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.000573) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000494) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000444)  DELETE FROM bars Bar Destroy (0.000468)  DELETE FROM bars
WHERE id = 23 WHERE id = 68
 
SQL (0.000404) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000446) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000486) 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.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') SQL (0.000614) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000418)  DELETE FROM foos Foo Destroy (0.000408)  DELETE FROM foos
WHERE id = 23 WHERE id = 55
 
SQL (0.000557) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000499) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000508) 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.000526) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000542) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000408)  DELETE FROM bars Bar Destroy (0.000664)  DELETE FROM bars
WHERE id = 25 WHERE id = 70
 
SQL (0.000373) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000438) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000411) 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.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.000601) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000632) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000447)  DELETE FROM foos Foo Destroy (0.000483)  DELETE FROM foos
WHERE id = 25 WHERE id = 57
 
SQL (0.000534) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000544) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000484) 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.000977) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.001524) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000510)  DELETE FROM bars Bar Destroy (0.000438)  DELETE FROM bars
WHERE id = 27 WHERE id = 72
 
SQL (0.000392) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000444) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.001124) 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.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') SQL (0.000622) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000433)  DELETE FROM foos Foo Update (0.000477) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 59
WHERE id = 27 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.000609) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000522) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000505) 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.000554) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000564) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000640)  DELETE FROM bars Bar Update (0.000493) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 74
WHERE id = 29 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.000635) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000511) 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.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.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.000669) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000627) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000551)  DELETE FROM foos Foo Update (0.000475) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 61
WHERE id = 29 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.000490) 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.000503) 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.000534) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000623) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000436)  DELETE FROM bars Bar Update (0.000507) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 76
WHERE id = 31 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.000460) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000501) 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.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.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.000601) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000644) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000463)  DELETE FROM foos Foo Update (0.000469) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 63
WHERE id = 31 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.000474) 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.000480) 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.000617) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000540) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000485)  DELETE FROM bars Bar Update (0.000453) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 78
WHERE id = 33 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.000474) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000485) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000450) 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.246580) 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.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.002094) 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.000622) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000496) 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 Destroy (0.000487)  DELETE FROM foos Foo Update (0.000098) UPDATE foos SET "image_content_type" = NULL, "image_file_name" = NULL WHERE id = 65
WHERE id = 1 Foo Destroy (0.000075)  DELETE FROM foos
WHERE id = 65
 
SQL (0.000480) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000487) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000534) 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.000625) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000533) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000498)  DELETE FROM bars Bar Update (0.000450) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 80
WHERE id = 1 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.000451) 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.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.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.000648) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000612) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000453)  DELETE FROM foos Foo Update (0.000446) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 67
WHERE id = 3 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.000567) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') SQL (0.000492) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000520) 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.000581) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000520) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000439)  DELETE FROM bars Bar Update (0.000508) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 82
WHERE id = 3 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.000420) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000554) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000442) 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.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') SQL (0.000631) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000472)  DELETE FROM foos Foo Update (0.000449) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 69
WHERE id = 5 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.000478) 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.000600) 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.000529) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000539) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000442)  DELETE FROM bars Bar Update (0.000552) UPDATE bars SET "document_content_type" = 'application/doc', "document_file_name" = NULL WHERE id = 87
WHERE id = 5 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.000619) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000500) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000440) 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.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') SQL (0.000638) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Foo Destroy (0.000430)  DELETE FROM foos Foo Update (0.000456) UPDATE foos SET "image_content_type" = 'image/jpg', "image_file_name" = NULL WHERE id = 73
WHERE id = 7 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
SQL (0.000461) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') WHERE id = 73
SQL (0.000472) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') 
SQL (0.000498) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') SQL (0.000626) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
Bar Destroy (0.000436)  DELETE FROM bars SQL (0.000659) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
WHERE id = 7 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
SQL (0.000452) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') Bar Update (0.000106) UPDATE bars SET "document_content_type" = NULL, "document_file_name" = NULL WHERE id = 89
SQL (0.000447) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc') Bar Destroy (0.000080)  DELETE FROM bars
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)  WHERE id = 89
SQL (0.000719) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg') 
Foo Destroy (0.000398)  DELETE FROM foos SQL (0.000476) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
WHERE id = 9 SQL (0.000491) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')

SQL (0.000482) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000611) INSERT INTO foos ("image_content_type", "image_file_name") VALUES('image/jpg', 'test_image.jpg')
SQL (0.000506) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
Bar Destroy (0.000414)  DELETE FROM bars
WHERE id = 9

SQL (0.000548) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
SQL (0.000462) INSERT INTO bars ("document_file_name", "document_content_type") VALUES('test_document.doc', 'application/doc')
...@@ -17,9 +17,9 @@ class PaperclipImagesTest < Test::Unit::TestCase ...@@ -17,9 +17,9 @@ class PaperclipImagesTest < Test::Unit::TestCase
def test_should_save_the_file_and_its_thumbnails def test_should_save_the_file_and_its_thumbnails
assert @foo.save assert @foo.save
assert File.exists?( @foo.image_filename(:original) ) assert File.exists?( @foo.image_filename(:original) ), @foo.image_filename(:original)
assert File.exists?( @foo.image_filename(:medium) ) assert File.exists?( @foo.image_filename(:medium) ), @foo.image_filename(:medium)
assert File.exists?( @foo.image_filename(:thumb) ) assert File.exists?( @foo.image_filename(:thumb) ), @foo.image_filename(:thumb)
assert File.size?( @foo.image_filename(:original) ) assert File.size?( @foo.image_filename(:original) )
assert File.size?( @foo.image_filename(:medium) ) assert File.size?( @foo.image_filename(:medium) )
assert File.size?( @foo.image_filename(:thumb) ) assert File.size?( @foo.image_filename(:thumb) )
...@@ -36,10 +36,9 @@ class PaperclipImagesTest < Test::Unit::TestCase ...@@ -36,10 +36,9 @@ class PaperclipImagesTest < Test::Unit::TestCase
def test_should_delete_all_thumbnails_on_destroy def test_should_delete_all_thumbnails_on_destroy
assert @foo.save assert @foo.save
names = [:original, :medium, :thumb].map{|style| @foo.image_filename(style) }
assert @foo.destroy assert @foo.destroy
assert !File.exists?( @foo.image_filename(:original) ) names.each {|path| assert !File.exists?( path ), path }
assert !File.exists?( @foo.image_filename(:medium) )
assert !File.exists?( @foo.image_filename(:thumb) )
end end
end end
\ No newline at end of file
...@@ -33,10 +33,11 @@ class PaperclipTest < Test::Unit::TestCase ...@@ -33,10 +33,11 @@ class PaperclipTest < Test::Unit::TestCase
def test_should_delete_files_on_destroy def test_should_delete_files_on_destroy
assert @bar.save assert @bar.save
assert File.exists?( @bar.document_filename ) assert File.exists?( @bar.document_filename ), @bar.document_filename
document_filename = @bar.document_filename
assert @bar.destroy assert @bar.destroy
assert !File.exists?( @bar.document_filename ) assert !File.exists?( document_filename ), document_filename
end end
end end
\ No newline at end of file
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