rails-uploader 0.2.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +162 -86
  4. data/app/assets/javascripts/uploader/application.js +6 -4
  5. data/app/assets/javascripts/uploader/jquery.uploader.js.coffee +58 -0
  6. data/app/controllers/uploader/attachments_controller.rb +63 -39
  7. data/app/views/uploader/default/_container.html.erb +19 -45
  8. data/app/views/uploader/default/_download.html.erb +4 -5
  9. data/app/views/uploader/default/_upload.html.erb +0 -1
  10. data/config/locales/en.yml +2 -0
  11. data/config/locales/ru.yml +3 -0
  12. data/config/locales/uk.yml +3 -0
  13. data/config/routes.rb +1 -1
  14. data/lib/uploader/asset.rb +63 -84
  15. data/lib/uploader/authorization.rb +52 -0
  16. data/lib/uploader/authorization_adapter.rb +24 -0
  17. data/lib/uploader/chunked_uploads.rb +15 -0
  18. data/lib/uploader/engine.rb +6 -0
  19. data/lib/uploader/file_part.rb +18 -0
  20. data/lib/uploader/fileuploads.rb +42 -65
  21. data/lib/uploader/helpers/field_tag.rb +10 -5
  22. data/lib/uploader/hooks/formtastic.rb +0 -13
  23. data/lib/uploader/upload_request.rb +72 -0
  24. data/lib/uploader/version.rb +1 -1
  25. data/lib/uploader.rb +41 -8
  26. data/spec/dummy/app/models/asset.rb +12 -0
  27. data/spec/dummy/app/models/picture.rb +6 -0
  28. data/spec/dummy/db/test.sqlite3 +0 -0
  29. data/spec/dummy/log/test.log +325 -0
  30. data/spec/dummy/public/uploads/picture/data/1/thumb_rails.png +0 -0
  31. data/spec/dummy/public/uploads/picture/data/3/thumb_rails.png +0 -0
  32. data/spec/fileuploads_spec.rb +4 -4
  33. data/spec/requests/attachments_controller_spec.rb +11 -12
  34. data/vendor/assets/javascripts/uploader/jquery.fileupload-process.js +175 -0
  35. data/vendor/assets/javascripts/uploader/jquery.fileupload-ui.js +164 -261
  36. data/vendor/assets/javascripts/uploader/jquery.fileupload-validate.js +122 -0
  37. data/vendor/assets/javascripts/uploader/jquery.fileupload.js +335 -101
  38. data/vendor/assets/javascripts/uploader/jquery.iframe-transport.js +47 -15
  39. data/vendor/assets/javascripts/uploader/vendor/jquery.ui.widget.js +572 -0
  40. data/vendor/assets/javascripts/uploader/vendor/tmpl.min.js +1 -0
  41. data/vendor/assets/stylesheets/uploader/default.css +26 -19
  42. metadata +12 -9
  43. data/vendor/assets/javascripts/uploader/jquery.fileupload-fp.js +0 -227
  44. data/vendor/assets/javascripts/uploader/jquery.ui.widget.js +0 -530
  45. data/vendor/assets/javascripts/uploader/load-image.min.js +0 -1
  46. data/vendor/assets/javascripts/uploader/locales/en.js +0 -27
  47. data/vendor/assets/javascripts/uploader/locales/ru.js +0 -27
  48. data/vendor/assets/javascripts/uploader/locales/uk.js +0 -27
  49. data/vendor/assets/javascripts/uploader/tmpl.min.js +0 -1
@@ -1,6 +1,8 @@
1
1
  module Uploader
2
2
  module Helpers
3
3
  class FieldTag
4
+ RESERVED_OPTIONS_KEYS = %(method_name object_name theme value object sortable).freeze
5
+
4
6
  attr_reader :template, :object, :theme
5
7
 
6
8
  delegate :uploader, to: :template
@@ -76,11 +78,14 @@ module Uploader
76
78
  end
77
79
 
78
80
  def input_html
79
- @input_html ||= {
80
- data: { url: attachments_path },
81
- multiple: multiple?,
82
- class: 'uploader'
83
- }.merge(@options[:input_html] || {})
81
+ @input_html ||= { multiple: multiple?, class: 'uploader' }.merge(input_html_options)
82
+ @input_html[:data] ||= {}
83
+ @input_html[:data][:url] ||= attachments_path
84
+ @input_html
85
+ end
86
+
87
+ def input_html_options
88
+ @options.select { |key, _value| !RESERVED_OPTIONS_KEYS.include?(key.to_s) }
84
89
  end
85
90
  end
86
91
  end
@@ -10,19 +10,6 @@ module Formtastic
10
10
  label_html << builder.uploader_field(method, input_html_options)
11
11
  end
12
12
  end
13
-
14
- def input_html_options
15
- data = super
16
- data[:confirm_delete] = options[:confirm_delete]
17
- data[:confirm_message] = localized_confirm_message
18
- data
19
- end
20
-
21
- protected
22
-
23
- def localized_confirm_message
24
- localized_string(method, method, :delete_confirmation) || I18n.t('uploader.confirm_delete')
25
- end
26
13
  end
27
14
  end
28
15
  end
@@ -0,0 +1,72 @@
1
+ require 'rack/request'
2
+ require 'fileutils'
3
+ require 'digest/sha1'
4
+
5
+ module Uploader
6
+ class UploadRequest < Rack::Request
7
+ SPLITTER = '/'.freeze
8
+
9
+ attr_reader :file
10
+
11
+ def initialize(env, file_or_part)
12
+ super(env)
13
+
14
+ @file = file_or_part
15
+ append_chunked_content
16
+ end
17
+
18
+ def completed?
19
+ !chunked? || chunked_completed?
20
+ end
21
+
22
+ def chunked?
23
+ content_length.to_i > 0 && @env['HTTP_CONTENT_RANGE']
24
+ end
25
+
26
+ def chunked_completed?
27
+ file.size == total_file_length
28
+ end
29
+
30
+ def total_file_length
31
+ return content_length.to_i unless chunked?
32
+ @env['HTTP_CONTENT_RANGE'].split(SPLITTER).last.to_i
33
+ end
34
+
35
+ def filename
36
+ @filename ||= @env['HTTP_CONTENT_DISPOSITION'].match(/filename="(.+)"/)[1]
37
+ end
38
+
39
+ def cleanup
40
+ FileUtils.rm(file.path, force: true)
41
+ end
42
+
43
+ protected
44
+
45
+ def append_chunked_content
46
+ return unless chunked?
47
+
48
+ tempfile.concat(@file)
49
+ @file = tempfile
50
+ end
51
+
52
+ def tempfile
53
+ @tempfile ||= FilePart.new(tempfile_path, filename)
54
+ end
55
+
56
+ def tempfile_path
57
+ File.join(Dir.tmpdir, tempfile_key + tempfile_extname)
58
+ end
59
+
60
+ def tempfile_key
61
+ Digest::SHA1.hexdigest([filename, ip, user_agent, csrf_token].join(SPLITTER))
62
+ end
63
+
64
+ def tempfile_extname
65
+ @tempfile_extname ||= File.extname(filename)
66
+ end
67
+
68
+ def csrf_token
69
+ @env['HTTP_X_CSRF_TOKEN']
70
+ end
71
+ end
72
+ end
@@ -1,3 +1,3 @@
1
1
  module Uploader
2
- VERSION = '0.2.8'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
data/lib/uploader.rb CHANGED
@@ -1,17 +1,46 @@
1
1
  # encoding: utf-8
2
2
  require 'securerandom'
3
+ require 'uploader/version'
3
4
 
5
+ # Main uploader module
4
6
  module Uploader
5
7
  autoload :Fileuploads, 'uploader/fileuploads'
6
8
  autoload :Asset, 'uploader/asset'
7
- autoload :AssetInstance, 'uploader/asset_instance'
9
+ autoload :Authorization, 'uploader/authorization'
10
+ autoload :AuthorizationAdapter, 'uploader/authorization_adapter'
11
+ autoload :ChunkedUploads, 'uploader/chunked_uploads'
12
+ autoload :UploadRequest, 'uploader/upload_request'
13
+ autoload :FilePart, 'uploader/file_part'
8
14
 
15
+ # Just Rails helpers
9
16
  module Helpers
10
17
  autoload :FormTagHelper, 'uploader/helpers/form_tag_helper'
11
18
  autoload :FormBuilder, 'uploader/helpers/form_builder'
12
19
  autoload :FieldTag, 'uploader/helpers/field_tag'
13
20
  end
14
21
 
22
+ # Column name to store unique fileupload guid
23
+ mattr_accessor :guid_column
24
+ @@guid_column = :guid
25
+
26
+ # The authorization adapter to use
27
+ mattr_accessor :authorization_adapter
28
+ @@authorization_adapter = Uploader::AuthorizationAdapter
29
+
30
+ mattr_accessor :current_user_proc
31
+ @@current_user_proc = nil
32
+
33
+ # Default way to setup Uploader
34
+ #
35
+ # Uploader.setup do |config|
36
+ # config.authorization_adapter = CanCanUploaderAdapter
37
+ # config.current_user_proc = -> (request) { request.env['warden'].user(:admin_user) }
38
+ # end
39
+ #
40
+ def self.setup
41
+ yield self
42
+ end
43
+
15
44
  def self.guid
16
45
  SecureRandom.base64(16).tr('+/=', 'xyz').slice(0, 20)
17
46
  end
@@ -33,15 +62,19 @@ module Uploader
33
62
  klass.safe_constantize
34
63
  end
35
64
 
36
- def self.content_type(user_agent)
37
- return 'application/json' if user_agent.blank?
65
+ # Exception class to raise when there is an authorized access
66
+ # exception thrown. The exception has a few goodies that may
67
+ # be useful for capturing / recognizing security issues.
68
+ class AccessDenied < StandardError
69
+ attr_reader :user, :action, :subject
38
70
 
39
- ie_version = user_agent.scan(/(MSIE\s|rv:)([\d\.]+)/).flatten.last
71
+ def initialize(user, action, subject)
72
+ @user, @action, @subject = user, action, subject
73
+ super
74
+ end
40
75
 
41
- if user_agent.include?('Android') || (ie_version && ie_version.to_f <= 9.0) || (user_agent =~ /Trident\/[0-9\.]+\;/i)
42
- 'text/plain'
43
- else
44
- 'application/json'
76
+ def message
77
+ I18n.t('uploader.access_denied.message')
45
78
  end
46
79
  end
47
80
  end
@@ -24,4 +24,16 @@ class Asset < ActiveRecord::Base
24
24
  include Uploader::Asset
25
25
 
26
26
  belongs_to :assetable, polymorphic: true
27
+
28
+ def filename
29
+ data_file_name
30
+ end
31
+
32
+ def content_type
33
+ data_content_type
34
+ end
35
+
36
+ def size
37
+ data_file_size
38
+ end
27
39
  end
@@ -1,3 +1,9 @@
1
1
  class Picture < Asset
2
2
  mount_uploader :data, PictureUploader, mount_on: :data_file_name
3
+
4
+ delegate :url, to: :data
5
+
6
+ def thumb_url
7
+ url(:thumb)
8
+ end
3
9
  end
Binary file
@@ -3173,3 +3173,328 @@ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-02-19 12:55:36 +0200
3173
3173
   (0.9ms) DELETE FROM "articles";
3174
3174
   (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3175
3175
   (0.1ms) DELETE FROM sqlite_sequence where name = 'articles';
3176
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
3177
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
3178
+  (0.1ms) begin transaction
3179
+ SQL (1.4ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:29:08.438518"], ["title", "MyString"], ["updated_at", "2016-06-06 15:29:08.438518"]]
3180
+  (0.8ms) commit transaction
3181
+  (0.1ms) begin transaction
3182
+ SQL (1.7ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:29:08.450083"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:29:08.450083"]]
3183
+  (0.9ms) commit transaction
3184
+ Picture Load (0.3ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."assetable_type" = 'Article' AND "assets"."guid" IS NULL ORDER BY "assets"."id" ASC LIMIT 1
3185
+ SQL (1.1ms) UPDATE "assets" SET "assetable_id" = 1000, "guid" = NULL WHERE "assets"."type" IN ('Picture') AND "assets"."assetable_type" = 'Article' AND "assets"."guid" IS NULL
3186
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? LIMIT 1 [["id", 1]]
3187
+ Picture Load (0.3ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."assetable_type" = 'Article' AND "assets"."guid" = 'kyAiZm9riQtqcxdoxWfR' ORDER BY "assets"."id" ASC LIMIT 1
3188
+  (1.0ms) DELETE FROM "assets";
3189
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3190
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'assets';
3191
+  (0.8ms) DELETE FROM "articles";
3192
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3193
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'articles';
3194
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
3195
+  (0.1ms) begin transaction
3196
+ SQL (1.3ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:29:59.495508"], ["title", "MyString"], ["updated_at", "2016-06-06 15:29:59.495508"]]
3197
+  (0.8ms) commit transaction
3198
+  (0.1ms) begin transaction
3199
+ SQL (1.7ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:29:59.507167"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:29:59.507167"]]
3200
+  (0.8ms) commit transaction
3201
+ Picture Load (0.3ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."assetable_type" = 'Article' AND "assets"."guid" IS NULL ORDER BY "assets"."id" ASC LIMIT 1
3202
+ SQL (1.0ms) UPDATE "assets" SET "assetable_id" = 1000, "guid" = NULL WHERE "assets"."type" IN ('Picture') AND "assets"."assetable_type" = 'Article' AND "assets"."guid" IS NULL
3203
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? LIMIT 1 [["id", 1]]
3204
+ Picture Load (0.3ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."assetable_type" = 'Article' AND "assets"."guid" = 'iHBdWsyCRUqG2BKrqJd7' ORDER BY "assets"."id" ASC LIMIT 1
3205
+  (1.2ms) DELETE FROM "assets";
3206
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3207
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'assets';
3208
+  (0.7ms) DELETE FROM "articles";
3209
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3210
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'articles';
3211
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
3212
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:30:13 +0300
3213
+  (0.2ms) begin transaction
3214
+ SQL (2.2ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:30:13.289159"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["type", "Picture"], ["updated_at", "2016-06-06 15:30:13.289159"]]
3215
+  (0.9ms) commit transaction
3216
+  (0.1ms) begin transaction
3217
+ SQL (0.9ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:30:13.365296"], ["title", "MyString"], ["updated_at", "2016-06-06 15:30:13.365296"]]
3218
+  (0.8ms) commit transaction
3219
+  (0.1ms) begin transaction
3220
+ SQL (0.6ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:30:13.376686"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:30:13.376686"]]
3221
+  (0.9ms) commit transaction
3222
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3223
+ Started DELETE "/uploader/attachments/" for 127.0.0.1 at 2016-06-06 18:30:13 +0300
3224
+  (0.2ms) begin transaction
3225
+ SQL (0.3ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:30:13.445535"], ["title", "MyString"], ["updated_at", "2016-06-06 15:30:13.445535"]]
3226
+  (0.9ms) commit transaction
3227
+  (0.1ms) begin transaction
3228
+ SQL (0.3ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:30:13.449493"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:30:13.449493"]]
3229
+  (0.9ms) commit transaction
3230
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-06-06 18:30:13 +0300
3231
+ Picture Load (0.3ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 0 ORDER BY "assets"."id" ASC LIMIT 1
3232
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:30:13 +0300
3233
+  (0.9ms) DELETE FROM "assets";
3234
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3235
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'assets';
3236
+  (0.7ms) DELETE FROM "articles";
3237
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3238
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'articles';
3239
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
3240
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:30:58 +0300
3241
+  (0.2ms) begin transaction
3242
+ SQL (2.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:30:58.546491"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["type", "Picture"], ["updated_at", "2016-06-06 15:30:58.546491"]]
3243
+  (0.9ms) commit transaction
3244
+  (0.1ms) begin transaction
3245
+ SQL (0.9ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:30:58.620358"], ["title", "MyString"], ["updated_at", "2016-06-06 15:30:58.620358"]]
3246
+  (0.8ms) commit transaction
3247
+  (0.1ms) begin transaction
3248
+ SQL (0.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:30:58.631533"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:30:58.631533"]]
3249
+  (0.8ms) commit transaction
3250
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3251
+ Started DELETE "/uploader/attachments/" for 127.0.0.1 at 2016-06-06 18:30:58 +0300
3252
+  (0.1ms) begin transaction
3253
+ SQL (0.3ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:30:58.692947"], ["title", "MyString"], ["updated_at", "2016-06-06 15:30:58.692947"]]
3254
+  (0.9ms) commit transaction
3255
+  (0.1ms) begin transaction
3256
+ SQL (0.3ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:30:58.696861"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:30:58.696861"]]
3257
+  (0.9ms) commit transaction
3258
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-06-06 18:30:58 +0300
3259
+ Picture Load (0.3ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 0 ORDER BY "assets"."id" ASC LIMIT 1
3260
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:30:58 +0300
3261
+  (1.0ms) DELETE FROM "assets";
3262
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3263
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'assets';
3264
+  (0.8ms) DELETE FROM "articles";
3265
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3266
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'articles';
3267
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
3268
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:31:18 +0300
3269
+  (0.3ms) begin transaction
3270
+ SQL (2.2ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:31:18.273292"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["type", "Picture"], ["updated_at", "2016-06-06 15:31:18.273292"]]
3271
+  (0.9ms) commit transaction
3272
+  (0.2ms) begin transaction
3273
+ SQL (0.9ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:31:18.350751"], ["title", "MyString"], ["updated_at", "2016-06-06 15:31:18.350751"]]
3274
+  (1.0ms) commit transaction
3275
+  (0.1ms) begin transaction
3276
+ SQL (0.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:31:18.365141"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:31:18.365141"]]
3277
+  (0.9ms) commit transaction
3278
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3279
+ Started DELETE "/uploader/attachments/" for 127.0.0.1 at 2016-06-06 18:31:18 +0300
3280
+  (0.2ms) begin transaction
3281
+ SQL (0.3ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:31:18.452551"], ["title", "MyString"], ["updated_at", "2016-06-06 15:31:18.452551"]]
3282
+  (0.9ms) commit transaction
3283
+  (0.1ms) begin transaction
3284
+ SQL (0.3ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:31:18.456692"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:31:18.456692"]]
3285
+  (0.9ms) commit transaction
3286
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-06-06 18:31:18 +0300
3287
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 0 ORDER BY "assets"."id" ASC LIMIT 1
3288
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:31:18 +0300
3289
+  (1.0ms) DELETE FROM "assets";
3290
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3291
+  (0.7ms) DELETE FROM sqlite_sequence where name = 'assets';
3292
+  (0.8ms) DELETE FROM "articles";
3293
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3294
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'articles';
3295
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
3296
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:31:33 +0300
3297
+  (0.1ms) begin transaction
3298
+ SQL (2.5ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:31:34.072296"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["type", "Picture"], ["updated_at", "2016-06-06 15:31:34.072296"]]
3299
+  (0.9ms) commit transaction
3300
+  (0.1ms) begin transaction
3301
+ SQL (0.9ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:31:34.147659"], ["title", "MyString"], ["updated_at", "2016-06-06 15:31:34.147659"]]
3302
+  (0.7ms) commit transaction
3303
+  (0.1ms) begin transaction
3304
+ SQL (0.5ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:31:34.158844"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:31:34.158844"]]
3305
+  (1.0ms) commit transaction
3306
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3307
+ Started DELETE "/uploader/attachments/" for 127.0.0.1 at 2016-06-06 18:31:34 +0300
3308
+  (0.1ms) begin transaction
3309
+ SQL (0.3ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:31:34.223368"], ["title", "MyString"], ["updated_at", "2016-06-06 15:31:34.223368"]]
3310
+  (0.9ms) commit transaction
3311
+  (0.1ms) begin transaction
3312
+ SQL (0.3ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:31:34.227250"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:31:34.227250"]]
3313
+  (0.8ms) commit transaction
3314
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-06-06 18:31:34 +0300
3315
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 0 ORDER BY "assets"."id" ASC LIMIT 1
3316
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:31:34 +0300
3317
+  (1.2ms) DELETE FROM "assets";
3318
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3319
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'assets';
3320
+  (0.7ms) DELETE FROM "articles";
3321
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3322
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'articles';
3323
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
3324
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:32:35 +0300
3325
+  (0.1ms) begin transaction
3326
+ SQL (2.2ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:32:35.670110"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["type", "Picture"], ["updated_at", "2016-06-06 15:32:35.670110"]]
3327
+  (0.8ms) commit transaction
3328
+  (0.1ms) begin transaction
3329
+ SQL (0.9ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:32:35.743570"], ["title", "MyString"], ["updated_at", "2016-06-06 15:32:35.743570"]]
3330
+  (0.8ms) commit transaction
3331
+  (0.1ms) begin transaction
3332
+ SQL (0.5ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:32:35.756631"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:32:35.756631"]]
3333
+  (0.9ms) commit transaction
3334
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3335
+ Started DELETE "/uploader/attachments/" for 127.0.0.1 at 2016-06-06 18:32:35 +0300
3336
+  (0.2ms) begin transaction
3337
+ SQL (0.3ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:32:35.821022"], ["title", "MyString"], ["updated_at", "2016-06-06 15:32:35.821022"]]
3338
+  (0.8ms) commit transaction
3339
+  (0.1ms) begin transaction
3340
+ SQL (0.3ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:32:35.824882"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:32:35.824882"]]
3341
+  (1.0ms) commit transaction
3342
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-06-06 18:32:35 +0300
3343
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 0 ORDER BY "assets"."id" ASC LIMIT 1
3344
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:32:35 +0300
3345
+  (1.1ms) DELETE FROM "assets";
3346
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3347
+  (0.9ms) DELETE FROM sqlite_sequence where name = 'assets';
3348
+  (0.7ms) DELETE FROM "articles";
3349
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3350
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'articles';
3351
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
3352
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:32:44 +0300
3353
+  (0.2ms) begin transaction
3354
+ SQL (0.7ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:32:44.542100"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["type", "Picture"], ["updated_at", "2016-06-06 15:32:44.542100"]]
3355
+  (0.8ms) commit transaction
3356
+  (0.2ms) begin transaction
3357
+ SQL (0.4ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:32:44.621199"], ["title", "MyString"], ["updated_at", "2016-06-06 15:32:44.621199"]]
3358
+  (0.8ms) commit transaction
3359
+  (0.1ms) begin transaction
3360
+ SQL (0.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:32:44.631376"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:32:44.631376"]]
3361
+  (0.8ms) commit transaction
3362
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3363
+ Started DELETE "/uploader/attachments/" for 127.0.0.1 at 2016-06-06 18:32:44 +0300
3364
+  (0.1ms) begin transaction
3365
+ SQL (0.3ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:32:44.692573"], ["title", "MyString"], ["updated_at", "2016-06-06 15:32:44.692573"]]
3366
+  (0.8ms) commit transaction
3367
+  (0.1ms) begin transaction
3368
+ SQL (0.6ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:32:44.696399"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:32:44.696399"]]
3369
+  (0.9ms) commit transaction
3370
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-06-06 18:32:44 +0300
3371
+ Picture Load (0.3ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 0 ORDER BY "assets"."id" ASC LIMIT 1
3372
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:32:44 +0300
3373
+  (1.1ms) DELETE FROM "assets";
3374
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3375
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'assets';
3376
+  (0.7ms) DELETE FROM "articles";
3377
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3378
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'articles';
3379
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
3380
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:37:50 +0300
3381
+  (0.2ms) begin transaction
3382
+ SQL (2.2ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:37:50.540551"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["type", "Picture"], ["updated_at", "2016-06-06 15:37:50.540551"]]
3383
+  (0.9ms) commit transaction
3384
+  (0.1ms) begin transaction
3385
+ SQL (1.0ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:37:50.614538"], ["title", "MyString"], ["updated_at", "2016-06-06 15:37:50.614538"]]
3386
+  (0.9ms) commit transaction
3387
+  (0.1ms) begin transaction
3388
+ SQL (0.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:37:50.629457"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:37:50.629457"]]
3389
+  (0.9ms) commit transaction
3390
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3391
+ Started DELETE "/uploader/attachments/" for 127.0.0.1 at 2016-06-06 18:37:50 +0300
3392
+  (0.2ms) begin transaction
3393
+ SQL (0.4ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:37:50.692807"], ["title", "MyString"], ["updated_at", "2016-06-06 15:37:50.692807"]]
3394
+  (0.8ms) commit transaction
3395
+  (0.1ms) begin transaction
3396
+ SQL (0.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:37:50.696889"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:37:50.696889"]]
3397
+  (1.1ms) commit transaction
3398
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-06-06 18:37:50 +0300
3399
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 0 ORDER BY "assets"."id" ASC LIMIT 1
3400
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:37:50 +0300
3401
+  (1.0ms) DELETE FROM "assets";
3402
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3403
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'assets';
3404
+  (0.8ms) DELETE FROM "articles";
3405
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3406
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'articles';
3407
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
3408
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:39:02 +0300
3409
+  (0.2ms) begin transaction
3410
+ SQL (2.5ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:39:02.896748"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["type", "Picture"], ["updated_at", "2016-06-06 15:39:02.896748"]]
3411
+  (0.8ms) commit transaction
3412
+  (0.1ms) begin transaction
3413
+ SQL (0.8ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:39:02.967362"], ["title", "MyString"], ["updated_at", "2016-06-06 15:39:02.967362"]]
3414
+  (0.9ms) commit transaction
3415
+  (0.1ms) begin transaction
3416
+ SQL (0.6ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:39:02.979112"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:39:02.979112"]]
3417
+  (1.3ms) commit transaction
3418
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3419
+ Started DELETE "/uploader/attachments/" for 127.0.0.1 at 2016-06-06 18:39:02 +0300
3420
+  (0.2ms) begin transaction
3421
+ SQL (0.3ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:39:03.040208"], ["title", "MyString"], ["updated_at", "2016-06-06 15:39:03.040208"]]
3422
+  (0.8ms) commit transaction
3423
+  (0.0ms) begin transaction
3424
+ SQL (0.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:39:03.044289"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:39:03.044289"]]
3425
+  (0.8ms) commit transaction
3426
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-06-06 18:39:03 +0300
3427
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 0 ORDER BY "assets"."id" ASC LIMIT 1
3428
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:39:03 +0300
3429
+  (1.0ms) DELETE FROM "assets";
3430
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3431
+  (1.2ms) DELETE FROM sqlite_sequence where name = 'assets';
3432
+  (0.8ms) DELETE FROM "articles";
3433
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3434
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'articles';
3435
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
3436
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:39:23 +0300
3437
+  (0.2ms) begin transaction
3438
+ SQL (2.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:39:24.022812"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["type", "Picture"], ["updated_at", "2016-06-06 15:39:24.022812"]]
3439
+  (1.8ms) commit transaction
3440
+  (0.1ms) begin transaction
3441
+ SQL (0.7ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:39:24.131617"], ["title", "MyString"], ["updated_at", "2016-06-06 15:39:24.131617"]]
3442
+  (1.7ms) commit transaction
3443
+  (0.2ms) begin transaction
3444
+ SQL (0.6ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:39:24.150265"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:39:24.150265"]]
3445
+  (1.0ms) commit transaction
3446
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3447
+ Started DELETE "/uploader/attachments/2" for 127.0.0.1 at 2016-06-06 18:39:24 +0300
3448
+ Picture Load (0.3ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 2 ORDER BY "assets"."id" ASC LIMIT 1
3449
+  (0.1ms) begin transaction
3450
+ SQL (0.5ms) DELETE FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? [["id", 2]]
3451
+  (0.9ms) commit transaction
3452
+  (0.3ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3453
+  (0.2ms) begin transaction
3454
+ SQL (0.4ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-06 15:39:24.250117"], ["title", "MyString"], ["updated_at", "2016-06-06 15:39:24.250117"]]
3455
+  (1.0ms) commit transaction
3456
+  (0.1ms) begin transaction
3457
+ SQL (0.5ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-06-06 15:39:24.270074"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-06 15:39:24.270074"]]
3458
+  (1.2ms) commit transaction
3459
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-06-06 18:39:24 +0300
3460
+ Picture Load (0.3ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 0 ORDER BY "assets"."id" ASC LIMIT 1
3461
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-06 18:39:24 +0300
3462
+  (1.1ms) DELETE FROM "assets";
3463
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3464
+  (1.3ms) DELETE FROM sqlite_sequence where name = 'assets';
3465
+  (1.1ms) DELETE FROM "articles";
3466
+  (0.2ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3467
+  (1.1ms) DELETE FROM sqlite_sequence where name = 'articles';
3468
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
3469
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-08 16:15:12 +0300
3470
+  (0.1ms) begin transaction
3471
+ SQL (2.2ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-08 13:15:13.046440"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["type", "Picture"], ["updated_at", "2016-06-08 13:15:13.046440"]]
3472
+  (0.8ms) commit transaction
3473
+  (0.1ms) begin transaction
3474
+ SQL (1.2ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-08 13:15:13.116947"], ["title", "MyString"], ["updated_at", "2016-06-08 13:15:13.116947"]]
3475
+  (1.0ms) commit transaction
3476
+  (0.1ms) begin transaction
3477
+ SQL (0.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-06-08 13:15:13.131176"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-08 13:15:13.131176"]]
3478
+  (0.8ms) commit transaction
3479
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3480
+ Started DELETE "/uploader/attachments/2" for 127.0.0.1 at 2016-06-08 16:15:13 +0300
3481
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 2 ORDER BY "assets"."id" ASC LIMIT 1
3482
+  (0.0ms) begin transaction
3483
+ SQL (0.3ms) DELETE FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? [["id", 2]]
3484
+  (0.8ms) commit transaction
3485
+  (0.2ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
3486
+  (0.1ms) begin transaction
3487
+ SQL (0.3ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", "2016-06-08 13:15:13.213701"], ["title", "MyString"], ["updated_at", "2016-06-08 13:15:13.213701"]]
3488
+  (0.7ms) commit transaction
3489
+  (0.1ms) begin transaction
3490
+ SQL (0.3ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-06-08 13:15:13.217333"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["type", "Picture"], ["updated_at", "2016-06-08 13:15:13.217333"]]
3491
+  (0.8ms) commit transaction
3492
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-06-08 16:15:13 +0300
3493
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = 0 ORDER BY "assets"."id" ASC LIMIT 1
3494
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2016-06-08 16:15:13 +0300
3495
+  (0.9ms) DELETE FROM "assets";
3496
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3497
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'assets';
3498
+  (0.9ms) DELETE FROM "articles";
3499
+  (0.1ms) SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
3500
+  (0.8ms) DELETE FROM sqlite_sequence where name = 'articles';