rails-uploader 0.2.7 → 0.2.8
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.
- checksums.yaml +4 -4
 - data/lib/uploader.rb +9 -10
 - data/lib/uploader/asset.rb +4 -7
 - data/lib/uploader/engine.rb +8 -12
 - data/lib/uploader/fileuploads.rb +32 -32
 - data/lib/uploader/helpers/field_tag.rb +20 -21
 - data/lib/uploader/helpers/form_builder.rb +1 -1
 - data/lib/uploader/helpers/form_tag_helper.rb +1 -1
 - data/lib/uploader/hooks/formtastic.rb +23 -14
 - data/lib/uploader/hooks/simple_form.rb +9 -5
 - data/lib/uploader/version.rb +1 -1
 - data/spec/dummy/app/models/article.rb +1 -3
 - data/spec/dummy/app/models/asset.rb +2 -2
 - data/spec/dummy/app/models/picture.rb +1 -3
 - data/spec/dummy/config/application.rb +2 -8
 - data/spec/dummy/config/environments/development.rb +2 -3
 - data/spec/dummy/config/environments/production.rb +2 -0
 - data/spec/dummy/config/environments/test.rb +2 -3
 - data/spec/dummy/db/test.sqlite3 +0 -0
 - data/spec/dummy/log/test.log +279 -0
 - data/spec/dummy/public/uploads/picture/data/1/thumb_rails.png +0 -0
 - data/spec/dummy/public/uploads/picture/data/3/thumb_rails.png +0 -0
 - data/spec/dummy/public/uploads/tmp/1455878520-6456-6895/rails.png +0 -0
 - data/spec/dummy/public/uploads/tmp/1455878520-6456-6895/thumb_rails.png +0 -0
 - data/spec/mongoid.yml +8 -13
 - data/spec/mongoid_spec.rb +3 -0
 - data/spec/spec_helper.rb +10 -16
 - metadata +34 -30
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 88c10bdc5c1c64828bf15e99962dee2c0e547eea
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 00ad13f2236fa9751d588bfac7275578dab4bd99
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 637a0ecdea91d3edabb08bb572a7a7739ae97ea6a2d8a8cbe76c724c64836c39fef17f9d6b94e96148a8f7a72bd685ea9c7615e48270e715a0e38d4e29bff136
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 6cda451daaf4e3d7a5728dcfe49c2cf5e9b8fa07e78e76128fd3d50bc82ad45f5178ae1a15f6a57dc703d7907e321a19a8e4c8cb07d3c6a3d85fafd2e26fe0d6
         
     | 
    
        data/lib/uploader.rb
    CHANGED
    
    | 
         @@ -5,7 +5,7 @@ module Uploader 
     | 
|
| 
       5 
5 
     | 
    
         
             
              autoload :Fileuploads, 'uploader/fileuploads'
         
     | 
| 
       6 
6 
     | 
    
         
             
              autoload :Asset, 'uploader/asset'
         
     | 
| 
       7 
7 
     | 
    
         
             
              autoload :AssetInstance, 'uploader/asset_instance'
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
       9 
9 
     | 
    
         
             
              module Helpers
         
     | 
| 
       10 
10 
     | 
    
         
             
                autoload :FormTagHelper, 'uploader/helpers/form_tag_helper'
         
     | 
| 
       11 
11 
     | 
    
         
             
                autoload :FormBuilder, 'uploader/helpers/form_builder'
         
     | 
| 
         @@ -15,11 +15,11 @@ module Uploader 
     | 
|
| 
       15 
15 
     | 
    
         
             
              def self.guid
         
     | 
| 
       16 
16 
     | 
    
         
             
                SecureRandom.base64(16).tr('+/=', 'xyz').slice(0, 20)
         
     | 
| 
       17 
17 
     | 
    
         
             
              end
         
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
       19 
19 
     | 
    
         
             
              def self.root_path
         
     | 
| 
       20 
     | 
    
         
            -
                @root_path ||= Pathname.new( 
     | 
| 
      
 20 
     | 
    
         
            +
                @root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__)))
         
     | 
| 
       21 
21 
     | 
    
         
             
              end
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
       23 
23 
     | 
    
         
             
              def self.assets
         
     | 
| 
       24 
24 
     | 
    
         
             
                Dir[root_path.join('vendor/assets/**/uploader/**', '*.{js,css,png,gif}')].inject([]) do |list, path|
         
     | 
| 
       25 
25 
     | 
    
         
             
                  folder = path.split('/assets/')[1].split('/')[0]
         
     | 
| 
         @@ -34,17 +34,16 @@ module Uploader 
     | 
|
| 
       34 
34 
     | 
    
         
             
              end
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
              def self.content_type(user_agent)
         
     | 
| 
       37 
     | 
    
         
            -
                return  
     | 
| 
      
 37 
     | 
    
         
            +
                return 'application/json' if user_agent.blank?
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                ie_version = user_agent.scan(/(MSIE\s|rv:)([\d\.]+)/).flatten.last
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
                if user_agent.include?( 
     | 
| 
       42 
     | 
    
         
            -
                   
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                if user_agent.include?('Android') || (ie_version && ie_version.to_f <= 9.0) || (user_agent =~ /Trident\/[0-9\.]+\;/i)
         
     | 
| 
      
 42 
     | 
    
         
            +
                  'text/plain'
         
     | 
| 
       43 
43 
     | 
    
         
             
                else
         
     | 
| 
       44 
     | 
    
         
            -
                   
     | 
| 
      
 44 
     | 
    
         
            +
                  'application/json'
         
     | 
| 
       45 
45 
     | 
    
         
             
                end
         
     | 
| 
       46 
46 
     | 
    
         
             
              end
         
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
       48 
47 
     | 
    
         
             
            end
         
     | 
| 
       49 
48 
     | 
    
         | 
| 
       50 
49 
     | 
    
         
             
            require 'uploader/engine'
         
     | 
    
        data/lib/uploader/asset.rb
    CHANGED
    
    | 
         @@ -27,10 +27,7 @@ module Uploader 
     | 
|
| 
       27 
27 
     | 
    
         
             
                    json_data['filename'] = File.basename(data.path)
         
     | 
| 
       28 
28 
     | 
    
         
             
                    json_data['size'] = data.file.size
         
     | 
| 
       29 
29 
     | 
    
         
             
                    json_data['id'] = json_data['_id']
         
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
                    if data.respond_to?(:thumb)
         
     | 
| 
       32 
     | 
    
         
            -
                      json_data['thumb_url'] = data.thumb.url
         
     | 
| 
       33 
     | 
    
         
            -
                    end
         
     | 
| 
      
 30 
     | 
    
         
            +
                    json_data['thumb_url'] = data.thumb.url if data.respond_to?(:thumb)
         
     | 
| 
       34 
31 
     | 
    
         | 
| 
       35 
32 
     | 
    
         
             
                    json_data
         
     | 
| 
       36 
33 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -61,7 +58,7 @@ module Uploader 
     | 
|
| 
       61 
58 
     | 
    
         
             
                  #
         
     | 
| 
       62 
59 
     | 
    
         
             
                  #   class Asset < ActiveRecord::Base
         
     | 
| 
       63 
60 
     | 
    
         
             
                  #     include Uploader::Asset
         
     | 
| 
       64 
     | 
    
         
            -
                  # 
     | 
| 
      
 61 
     | 
    
         
            +
                  #
         
     | 
| 
       65 
62 
     | 
    
         
             
                  #     def uploader_create(params, request = nil)
         
     | 
| 
       66 
63 
     | 
    
         
             
                  #       self.user = request.env['warden'].user
         
     | 
| 
       67 
64 
     | 
    
         
             
                  #       super
         
     | 
| 
         @@ -74,13 +71,13 @@ module Uploader 
     | 
|
| 
       74 
71 
     | 
    
         
             
                    self.assetable_id = assetable_id_format(params[:assetable_id])
         
     | 
| 
       75 
72 
     | 
    
         
             
                    save
         
     | 
| 
       76 
73 
     | 
    
         
             
                  end
         
     | 
| 
       77 
     | 
    
         
            -
             
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
       78 
75 
     | 
    
         
             
                  # Destroy asset
         
     | 
| 
       79 
76 
     | 
    
         
             
                  # Usage (cancan example):
         
     | 
| 
       80 
77 
     | 
    
         
             
                  #
         
     | 
| 
       81 
78 
     | 
    
         
             
                  #   class Asset < ActiveRecord::Base
         
     | 
| 
       82 
79 
     | 
    
         
             
                  #     include Uploader::Asset
         
     | 
| 
       83 
     | 
    
         
            -
                  # 
     | 
| 
      
 80 
     | 
    
         
            +
                  #
         
     | 
| 
       84 
81 
     | 
    
         
             
                  #     def uploader_destroy(params, request = nil)
         
     | 
| 
       85 
82 
     | 
    
         
             
                  #       ability = Ability.new(request.env['warden'].user)
         
     | 
| 
       86 
83 
     | 
    
         
             
                  #       if ability.can? :delete, self
         
     | 
    
        data/lib/uploader/engine.rb
    CHANGED
    
    | 
         @@ -4,26 +4,22 @@ require 'uploader' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            module Uploader
         
     | 
| 
       5 
5 
     | 
    
         
             
              class Engine < ::Rails::Engine
         
     | 
| 
       6 
6 
     | 
    
         
             
                isolate_namespace Uploader
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
                initializer  
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                initializer 'uploader.assets_precompile' do |app|
         
     | 
| 
       9 
9 
     | 
    
         
             
                  app.config.assets.precompile += Uploader.assets
         
     | 
| 
       10 
10 
     | 
    
         
             
                end
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
                initializer  
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                initializer 'uploader.helpers' do
         
     | 
| 
       13 
13 
     | 
    
         
             
                  ActiveSupport.on_load :action_view do
         
     | 
| 
       14 
14 
     | 
    
         
             
                    ActionView::Base.send(:include, Uploader::Helpers::FormTagHelper)
         
     | 
| 
       15 
15 
     | 
    
         
             
                    ActionView::Helpers::FormBuilder.send(:include, Uploader::Helpers::FormBuilder)
         
     | 
| 
       16 
16 
     | 
    
         
             
                  end
         
     | 
| 
       17 
17 
     | 
    
         
             
                end
         
     | 
| 
       18 
     | 
    
         
            -
               
         
     | 
| 
       19 
     | 
    
         
            -
                initializer "uploader.hooks" do
         
     | 
| 
       20 
     | 
    
         
            -
                  require "uploader/hooks/active_record" if Object.const_defined?("ActiveRecord")
         
     | 
| 
       21 
18 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
                   
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
                  end
         
     | 
| 
      
 19 
     | 
    
         
            +
                initializer 'uploader.hooks' do
         
     | 
| 
      
 20 
     | 
    
         
            +
                  require 'uploader/hooks/active_record' if Object.const_defined?('ActiveRecord')
         
     | 
| 
      
 21 
     | 
    
         
            +
                  require 'uploader/hooks/simple_form'   if Object.const_defined?('SimpleForm')
         
     | 
| 
      
 22 
     | 
    
         
            +
                  require 'uploader/hooks/formtastic'    if Object.const_defined?('Formtastic')
         
     | 
| 
       27 
23 
     | 
    
         
             
                end
         
     | 
| 
       28 
24 
     | 
    
         
             
              end
         
     | 
| 
       29 
25 
     | 
    
         
             
            end
         
     | 
    
        data/lib/uploader/fileuploads.rb
    CHANGED
    
    | 
         @@ -17,7 +17,7 @@ module Uploader 
     | 
|
| 
       17 
17 
     | 
    
         
             
                module SingletonMethods
         
     | 
| 
       18 
18 
     | 
    
         
             
                  # Join ActiveRecord object with uploaded file
         
     | 
| 
       19 
19 
     | 
    
         
             
                  # Usage:
         
     | 
| 
       20 
     | 
    
         
            -
                  # 
     | 
| 
      
 20 
     | 
    
         
            +
                  #
         
     | 
| 
       21 
21 
     | 
    
         
             
                  #   class Article < ActiveRecord::Base
         
     | 
| 
       22 
22 
     | 
    
         
             
                  #     has_one :picture, :as => :assetable, :dependent => :destroy
         
     | 
| 
       23 
23 
     | 
    
         
             
                  #
         
     | 
| 
         @@ -27,40 +27,40 @@ module Uploader 
     | 
|
| 
       27 
27 
     | 
    
         
             
                  #
         
     | 
| 
       28 
28 
     | 
    
         
             
                  def fileuploads(*args)
         
     | 
| 
       29 
29 
     | 
    
         
             
                    options = args.extract_options!
         
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
                     
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
                    self.fileuploads_columns = args.map(&:to_sym)
         
     | 
| 
       36 
     | 
    
         
            -
                    
         
     | 
| 
       37 
     | 
    
         
            -
                    unless self.is_a?(ClassMethods)
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                    unless respond_to?(:fileuploads_options)
         
     | 
| 
      
 32 
     | 
    
         
            +
                      class_attribute(:fileuploads_options, instance_writer: false)
         
     | 
| 
      
 33 
     | 
    
         
            +
                      self.fileuploads_options ||= {}
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
       38 
35 
     | 
    
         
             
                      include InstanceMethods
         
     | 
| 
       39 
36 
     | 
    
         
             
                      extend ClassMethods
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
       41 
38 
     | 
    
         
             
                      after_save :fileuploads_update, if: :fileupload_changed?
         
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
      
 39 
     | 
    
         
            +
                    end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                    args.each do |name|
         
     | 
| 
      
 42 
     | 
    
         
            +
                      fileuploads_options[name] = options
         
     | 
| 
      
 43 
     | 
    
         
            +
                      accepts_nested_attributes_for(name, allow_destroy: true)
         
     | 
| 
       44 
44 
     | 
    
         
             
                    end
         
     | 
| 
       45 
45 
     | 
    
         
             
                  end
         
     | 
| 
       46 
46 
     | 
    
         
             
                end
         
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
       48 
48 
     | 
    
         
             
                module ClassMethods
         
     | 
| 
       49 
49 
     | 
    
         
             
                  # Update reflection klass by guid
         
     | 
| 
       50 
50 
     | 
    
         
             
                  def fileupload_update(record_id, guid, method)
         
     | 
| 
       51 
51 
     | 
    
         
             
                    fileupload_scope(method, guid).update_all(assetable_id: record_id, guid: nil)
         
     | 
| 
       52 
52 
     | 
    
         
             
                  end
         
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
       54 
54 
     | 
    
         
             
                  # Find asset(s) by guid
         
     | 
| 
       55 
55 
     | 
    
         
             
                  def fileupload_find(method, guid)
         
     | 
| 
       56 
     | 
    
         
            -
                     
     | 
| 
       57 
     | 
    
         
            -
                    fileupload_multiple?(method) ?  
     | 
| 
      
 56 
     | 
    
         
            +
                    query = fileupload_scope(method, guid)
         
     | 
| 
      
 57 
     | 
    
         
            +
                    fileupload_multiple?(method) ? query : query.first
         
     | 
| 
       58 
58 
     | 
    
         
             
                  end
         
     | 
| 
       59 
59 
     | 
    
         | 
| 
       60 
60 
     | 
    
         
             
                  def fileupload_scope(method, guid)
         
     | 
| 
       61 
61 
     | 
    
         
             
                    fileupload_klass(method).where(guid: guid, assetable_type: base_class.name.to_s)
         
     | 
| 
       62 
62 
     | 
    
         
             
                  end
         
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
       64 
64 
     | 
    
         
             
                  # Find class by reflection
         
     | 
| 
       65 
65 
     | 
    
         
             
                  def fileupload_klass(method)
         
     | 
| 
       66 
66 
     | 
    
         
             
                    reflect_on_association(method.to_sym).klass
         
     | 
| 
         @@ -69,7 +69,7 @@ module Uploader 
     | 
|
| 
       69 
69 
     | 
    
         
             
                  def fileupload_multiple?(method)
         
     | 
| 
       70 
70 
     | 
    
         
             
                    association = reflect_on_association(method.to_sym)
         
     | 
| 
       71 
71 
     | 
    
         | 
| 
       72 
     | 
    
         
            -
                    # many? for Mongoid 
     | 
| 
      
 72 
     | 
    
         
            +
                    # many? for Mongoid and :collection? for AR
         
     | 
| 
       73 
73 
     | 
    
         
             
                    method_name = association.respond_to?(:many?) ? :many? : :collection?
         
     | 
| 
       74 
74 
     | 
    
         | 
| 
       75 
75 
     | 
    
         
             
                    !!(association && association.send(method_name))
         
     | 
| 
         @@ -81,26 +81,26 @@ module Uploader 
     | 
|
| 
       81 
81 
     | 
    
         
             
                    end
         
     | 
| 
       82 
82 
     | 
    
         
             
                  end
         
     | 
| 
       83 
83 
     | 
    
         
             
                end
         
     | 
| 
       84 
     | 
    
         
            -
             
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
       85 
85 
     | 
    
         
             
                module InstanceMethods
         
     | 
| 
       86 
86 
     | 
    
         
             
                  # Generate unique key
         
     | 
| 
       87 
87 
     | 
    
         
             
                  def fileupload_guid
         
     | 
| 
       88 
88 
     | 
    
         
             
                    @fileupload_guid ||= Uploader.guid
         
     | 
| 
       89 
89 
     | 
    
         
             
                  end
         
     | 
| 
       90 
     | 
    
         
            -
             
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
       91 
91 
     | 
    
         
             
                  def fileupload_guid=(value)
         
     | 
| 
       92 
92 
     | 
    
         
             
                    @fileupload_changed = true unless value.blank?
         
     | 
| 
       93 
93 
     | 
    
         
             
                    @fileupload_guid = value.blank? ? nil : value
         
     | 
| 
       94 
94 
     | 
    
         
             
                  end
         
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
      
 95 
     | 
    
         
            +
             
     | 
| 
       96 
96 
     | 
    
         
             
                  def fileupload_changed?
         
     | 
| 
       97 
     | 
    
         
            -
                    @fileupload_changed  
     | 
| 
      
 97 
     | 
    
         
            +
                    @fileupload_changed == true
         
     | 
| 
       98 
98 
     | 
    
         
             
                  end
         
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
      
 99 
     | 
    
         
            +
             
     | 
| 
       100 
100 
     | 
    
         
             
                  def fileupload_multiple?(method)
         
     | 
| 
       101 
101 
     | 
    
         
             
                    self.class.fileupload_multiple?(method)
         
     | 
| 
       102 
102 
     | 
    
         
             
                  end
         
     | 
| 
       103 
     | 
    
         
            -
             
     | 
| 
      
 103 
     | 
    
         
            +
             
     | 
| 
       104 
104 
     | 
    
         
             
                  # Find or build new asset object
         
     | 
| 
       105 
105 
     | 
    
         
             
                  def fileupload_asset(method)
         
     | 
| 
       106 
106 
     | 
    
         
             
                    if fileuploads_columns.include?(method.to_sym)
         
     | 
| 
         @@ -109,18 +109,18 @@ module Uploader 
     | 
|
| 
       109 
109 
     | 
    
         
             
                      asset
         
     | 
| 
       110 
110 
     | 
    
         
             
                    end
         
     | 
| 
       111 
111 
     | 
    
         
             
                  end
         
     | 
| 
       112 
     | 
    
         
            -
             
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
       113 
113 
     | 
    
         
             
                  def fileuploads_columns
         
     | 
| 
       114 
     | 
    
         
            -
                    self.class. 
     | 
| 
      
 114 
     | 
    
         
            +
                    self.class.fileuploads_options.keys
         
     | 
| 
       115 
115 
     | 
    
         
             
                  end
         
     | 
| 
       116 
     | 
    
         
            -
             
     | 
| 
      
 116 
     | 
    
         
            +
             
     | 
| 
       117 
117 
     | 
    
         
             
                  protected
         
     | 
| 
       118 
     | 
    
         
            -
             
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
             
     | 
| 
       121 
     | 
    
         
            -
             
     | 
| 
       122 
     | 
    
         
            -
                      end
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
                  def fileuploads_update
         
     | 
| 
      
 120 
     | 
    
         
            +
                    fileuploads_options.each do |method, _options|
         
     | 
| 
      
 121 
     | 
    
         
            +
                      self.class.fileupload_update(id, fileupload_guid, method)
         
     | 
| 
       123 
122 
     | 
    
         
             
                    end
         
     | 
| 
      
 123 
     | 
    
         
            +
                  end
         
     | 
| 
       124 
124 
     | 
    
         
             
                end
         
     | 
| 
       125 
125 
     | 
    
         
             
              end
         
     | 
| 
       126 
126 
     | 
    
         
             
            end
         
     | 
| 
         @@ -3,8 +3,8 @@ module Uploader 
     | 
|
| 
       3 
3 
     | 
    
         
             
                class FieldTag
         
     | 
| 
       4 
4 
     | 
    
         
             
                  attr_reader :template, :object, :theme
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
                  delegate :uploader, to: :template 
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
      
 6 
     | 
    
         
            +
                  delegate :uploader, to: :template
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
       8 
8 
     | 
    
         
             
                  # Wrapper for render uploader field
         
     | 
| 
       9 
9 
     | 
    
         
             
                  # Usage:
         
     | 
| 
       10 
10 
     | 
    
         
             
                  #
         
     | 
| 
         @@ -12,13 +12,12 @@ module Uploader 
     | 
|
| 
       12 
12 
     | 
    
         
             
                  #   uploader.render
         
     | 
| 
       13 
13 
     | 
    
         
             
                  #
         
     | 
| 
       14 
14 
     | 
    
         
             
                  def initialize(object_name, method_name, template, options = {}) #:nodoc:
         
     | 
| 
       15 
     | 
    
         
            -
                    options = { object_name: object_name, method_name: method_name }.merge(options)
         
     | 
| 
      
 15 
     | 
    
         
            +
                    @options = { object_name: object_name, method_name: method_name }.merge(options)
         
     | 
| 
      
 16 
     | 
    
         
            +
                    @template = template
         
     | 
| 
       16 
17 
     | 
    
         | 
| 
       17 
     | 
    
         
            -
                    @ 
     | 
| 
       18 
     | 
    
         
            -
                    
         
     | 
| 
       19 
     | 
    
         
            -
                    @theme = (@options.delete(:theme) || "default")
         
     | 
| 
      
 18 
     | 
    
         
            +
                    @theme = (@options.delete(:theme) || 'default')
         
     | 
| 
       20 
19 
     | 
    
         
             
                    @value = @options.delete(:value) if @options.key?(:value)
         
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
       22 
21 
     | 
    
         
             
                    @object = @options.delete(:object) if @options.key?(:object)
         
     | 
| 
       23 
22 
     | 
    
         
             
                    @object ||= @template.instance_variable_get("@#{object_name}")
         
     | 
| 
       24 
23 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -27,31 +26,31 @@ module Uploader 
     | 
|
| 
       27 
26 
     | 
    
         
             
                    locals = { field: self }.merge(locals)
         
     | 
| 
       28 
27 
     | 
    
         
             
                    @template.render(partial: "uploader/#{@theme}/container", locals: locals)
         
     | 
| 
       29 
28 
     | 
    
         
             
                  end
         
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
       31 
30 
     | 
    
         
             
                  def id
         
     | 
| 
       32 
31 
     | 
    
         
             
                    @id ||= @template.dom_id(@object, [method_name, 'uploader'].join('_'))
         
     | 
| 
       33 
32 
     | 
    
         
             
                  end
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
       35 
34 
     | 
    
         
             
                  def method_name
         
     | 
| 
       36 
35 
     | 
    
         
             
                    @options[:method_name]
         
     | 
| 
       37 
36 
     | 
    
         
             
                  end
         
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
       39 
38 
     | 
    
         
             
                  def object_name
         
     | 
| 
       40 
39 
     | 
    
         
             
                    @options[:object_name]
         
     | 
| 
       41 
40 
     | 
    
         
             
                  end
         
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
       43 
42 
     | 
    
         
             
                  def multiple?
         
     | 
| 
       44 
43 
     | 
    
         
             
                    @object.fileupload_multiple?(method_name)
         
     | 
| 
       45 
44 
     | 
    
         
             
                  end
         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
       47 
46 
     | 
    
         
             
                  def value
         
     | 
| 
       48 
47 
     | 
    
         
             
                    @value ||= @object.fileupload_asset(method_name)
         
     | 
| 
       49 
48 
     | 
    
         
             
                  end
         
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
       51 
50 
     | 
    
         
             
                  def values
         
     | 
| 
       52 
51 
     | 
    
         
             
                    Array.wrap(value)
         
     | 
| 
       53 
52 
     | 
    
         
             
                  end
         
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
       55 
54 
     | 
    
         
             
                  def exists?
         
     | 
| 
       56 
55 
     | 
    
         
             
                    values.map(&:persisted?).any?
         
     | 
| 
       57 
56 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -59,28 +58,28 @@ module Uploader 
     | 
|
| 
       59 
58 
     | 
    
         
             
                  def sortable?
         
     | 
| 
       60 
59 
     | 
    
         
             
                    @options[:sortable] == true
         
     | 
| 
       61 
60 
     | 
    
         
             
                  end
         
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
       63 
62 
     | 
    
         
             
                  def klass
         
     | 
| 
       64 
63 
     | 
    
         
             
                    @klass ||= @object.class.fileupload_klass(method_name)
         
     | 
| 
       65 
64 
     | 
    
         
             
                  end
         
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
       67 
66 
     | 
    
         
             
                  def attachments_path(options = {})
         
     | 
| 
       68 
67 
     | 
    
         
             
                    options = {
         
     | 
| 
       69 
68 
     | 
    
         
             
                      guid: @object.fileupload_guid,
         
     | 
| 
       70 
69 
     | 
    
         
             
                      assetable_type: @object.class.base_class.name.to_s,
         
     | 
| 
       71 
70 
     | 
    
         
             
                      klass: klass.to_s
         
     | 
| 
       72 
71 
     | 
    
         
             
                    }.merge(options)
         
     | 
| 
       73 
     | 
    
         
            -
             
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
       74 
73 
     | 
    
         
             
                    options[:assetable_id] = @object.id if @object.persisted?
         
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
       76 
75 
     | 
    
         
             
                    uploader.attachments_path(options)
         
     | 
| 
       77 
76 
     | 
    
         
             
                  end
         
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
       79 
78 
     | 
    
         
             
                  def input_html
         
     | 
| 
       80 
79 
     | 
    
         
             
                    @input_html ||= {
         
     | 
| 
       81 
     | 
    
         
            -
                      data: {url: attachments_path},
         
     | 
| 
      
 80 
     | 
    
         
            +
                      data: { url: attachments_path },
         
     | 
| 
       82 
81 
     | 
    
         
             
                      multiple: multiple?,
         
     | 
| 
       83 
     | 
    
         
            -
                      class:  
     | 
| 
      
 82 
     | 
    
         
            +
                      class: 'uploader'
         
     | 
| 
       84 
83 
     | 
    
         
             
                    }.merge(@options[:input_html] || {})
         
     | 
| 
       85 
84 
     | 
    
         
             
                  end
         
     | 
| 
       86 
85 
     | 
    
         
             
                end
         
     | 
| 
         @@ -1,19 +1,28 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'formtastic'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
               
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
                   
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Formtastic
         
     | 
| 
      
 4 
     | 
    
         
            +
              module Inputs
         
     | 
| 
      
 5 
     | 
    
         
            +
                class UploaderInput
         
     | 
| 
      
 6 
     | 
    
         
            +
                  include ::Formtastic::Inputs::Base
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
                  def to_html
         
     | 
| 
      
 9 
     | 
    
         
            +
                    input_wrapping do
         
     | 
| 
      
 10 
     | 
    
         
            +
                      label_html << builder.uploader_field(method, input_html_options)
         
     | 
| 
      
 11 
     | 
    
         
            +
                    end
         
     | 
| 
      
 12 
     | 
    
         
            +
                  end
         
     | 
| 
       12 
13 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            +
                end
         
     | 
| 
       18 
27 
     | 
    
         
             
              end
         
     | 
| 
       19 
28 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,8 +1,12 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require  
     | 
| 
      
 1 
     | 
    
         
            +
            require 'simple_form'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
               
     | 
| 
       5 
     | 
    
         
            -
                 
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
            module SimpleForm
         
     | 
| 
      
 4 
     | 
    
         
            +
              module Inputs
         
     | 
| 
      
 5 
     | 
    
         
            +
                class UploaderInput < ::SimpleForm::Inputs::Base
         
     | 
| 
      
 6 
     | 
    
         
            +
                  def input(wrapper_options = nil)
         
     | 
| 
      
 7 
     | 
    
         
            +
                    merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
         
     | 
| 
      
 8 
     | 
    
         
            +
                    @builder.uploader_field(attribute_name, merged_input_options)
         
     | 
| 
      
 9 
     | 
    
         
            +
                  end
         
     | 
| 
      
 10 
     | 
    
         
            +
                end
         
     | 
| 
       7 
11 
     | 
    
         
             
              end
         
     | 
| 
       8 
12 
     | 
    
         
             
            end
         
     | 
    
        data/lib/uploader/version.rb
    CHANGED
    
    
| 
         @@ -3,7 +3,7 @@ require File.expand_path('../boot', __FILE__) 
     | 
|
| 
       3 
3 
     | 
    
         
             
            require 'rails/all'
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            Bundler.require
         
     | 
| 
       6 
     | 
    
         
            -
            require  
     | 
| 
      
 6 
     | 
    
         
            +
            require 'rails-uploader'
         
     | 
| 
       7 
7 
     | 
    
         
             
            require 'carrierwave'
         
     | 
| 
       8 
8 
     | 
    
         
             
            require 'carrierwave/orm/activerecord'
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
         @@ -32,7 +32,7 @@ module Dummy 
     | 
|
| 
       32 
32 
     | 
    
         
             
                # config.i18n.default_locale = :de
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
                # Configure the default encoding used in templates for Ruby 1.9.
         
     | 
| 
       35 
     | 
    
         
            -
                config.encoding =  
     | 
| 
      
 35 
     | 
    
         
            +
                config.encoding = 'utf-8'
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
37 
     | 
    
         
             
                # Configure sensitive parameters which will be filtered from the log file.
         
     | 
| 
       38 
38 
     | 
    
         
             
                config.filter_parameters += [:password]
         
     | 
| 
         @@ -42,12 +42,6 @@ module Dummy 
     | 
|
| 
       42 
42 
     | 
    
         
             
                # like if you have constraints or database-specific column types
         
     | 
| 
       43 
43 
     | 
    
         
             
                # config.active_record.schema_format = :sql
         
     | 
| 
       44 
44 
     | 
    
         | 
| 
       45 
     | 
    
         
            -
                # Enforce whitelist mode for mass assignment.
         
     | 
| 
       46 
     | 
    
         
            -
                # This will create an empty whitelist of attributes available for mass-assignment for all models
         
     | 
| 
       47 
     | 
    
         
            -
                # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
         
     | 
| 
       48 
     | 
    
         
            -
                # parameters by using an attr_accessible or attr_protected declaration.
         
     | 
| 
       49 
     | 
    
         
            -
                config.active_record.whitelist_attributes = true
         
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
45 
     | 
    
         
             
                # Enable the asset pipeline
         
     | 
| 
       52 
46 
     | 
    
         
             
                config.assets.enabled = true
         
     | 
| 
       53 
47 
     | 
    
         | 
| 
         @@ -22,9 +22,6 @@ Dummy::Application.configure do 
     | 
|
| 
       22 
22 
     | 
    
         
             
              # Only use best-standards-support built into browsers
         
     | 
| 
       23 
23 
     | 
    
         
             
              config.action_dispatch.best_standards_support = :builtin
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
              # Raise exception on mass assignment protection for Active Record models
         
     | 
| 
       26 
     | 
    
         
            -
              config.active_record.mass_assignment_sanitizer = :strict
         
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
25 
     | 
    
         
             
              # Log the query plan for queries taking more than this (works
         
     | 
| 
       29 
26 
     | 
    
         
             
              # with SQLite, MySQL, and PostgreSQL)
         
     | 
| 
       30 
27 
     | 
    
         
             
              config.active_record.auto_explain_threshold_in_seconds = 0.5
         
     | 
| 
         @@ -34,4 +31,6 @@ Dummy::Application.configure do 
     | 
|
| 
       34 
31 
     | 
    
         | 
| 
       35 
32 
     | 
    
         
             
              # Expands the lines which load the assets
         
     | 
| 
       36 
33 
     | 
    
         
             
              config.assets.debug = true
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
              config.eager_load = false
         
     | 
| 
       37 
36 
     | 
    
         
             
            end
         
     | 
| 
         @@ -29,9 +29,8 @@ Dummy::Application.configure do 
     | 
|
| 
       29 
29 
     | 
    
         
             
              # ActionMailer::Base.deliveries array.
         
     | 
| 
       30 
30 
     | 
    
         
             
              config.action_mailer.delivery_method = :test
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
     | 
    
         
            -
              # Raise exception on mass assignment protection for Active Record models
         
     | 
| 
       33 
     | 
    
         
            -
              config.active_record.mass_assignment_sanitizer = :strict
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
32 
     | 
    
         
             
              # Print deprecation notices to the stderr
         
     | 
| 
       36 
33 
     | 
    
         
             
              config.active_support.deprecation = :stderr
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
              config.eager_load = false
         
     | 
| 
       37 
36 
     | 
    
         
             
            end
         
     | 
    
        data/spec/dummy/db/test.sqlite3
    CHANGED
    
    | 
         Binary file 
     | 
    
        data/spec/dummy/log/test.log
    CHANGED
    
    | 
         @@ -2894,3 +2894,282 @@ Started POST "/uploader/attachments" for 127.0.0.1 at 2015-09-16 17:13:13 +0300 
     | 
|
| 
       2894 
2894 
     | 
    
         
             
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
       2895 
2895 
     | 
    
         
             
              [1m[36m (0.1ms)[0m  [1mrollback transaction[0m
         
     | 
| 
       2896 
2896 
     | 
    
         
             
              MOPED: 127.0.0.1:27017 QUERY        database=rails_uploader_test collection=system.namespaces selector={:name=>{"$not"=>/system|\$/}} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.4759ms)
         
     | 
| 
      
 2897 
     | 
    
         
            +
            Connecting to database specified by database.yml
         
     | 
| 
      
 2898 
     | 
    
         
            +
            Connecting to database specified by database.yml
         
     | 
| 
      
 2899 
     | 
    
         
            +
            Connecting to database specified by database.yml
         
     | 
| 
      
 2900 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2901 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2902 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2903 
     | 
    
         
            +
            Started POST "/uploader/attachments" for 127.0.0.1 at 2016-02-19 12:42:00 +0200
         
     | 
| 
      
 2904 
     | 
    
         
            +
              [1m[35m (0.2ms)[0m  begin transaction
         
     | 
| 
      
 2905 
     | 
    
         
            +
              [1m[36mPicture Exists (0.6ms)[0m  [1mSELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'xbjexK94H2AHrQFFSyar' LIMIT 1[0m
         
     | 
| 
      
 2906 
     | 
    
         
            +
              [1m[35mSQL (1.7ms)[0m  INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:42:00.862025"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["public_token", "xbjexK94H2AHrQFFSyar"], ["type", "Picture"], ["updated_at", "2016-02-19 10:42:00.862025"]]
         
     | 
| 
      
 2907 
     | 
    
         
            +
              [1m[36m (0.9ms)[0m  [1mcommit transaction[0m
         
     | 
| 
      
 2908 
     | 
    
         
            +
              [1m[35m (0.3ms)[0m  begin transaction
         
     | 
| 
      
 2909 
     | 
    
         
            +
              [1m[36mSQL (1.1ms)[0m  [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m  [["content", "MyText"], ["created_at", "2016-02-19 10:42:01.003470"], ["title", "MyString"], ["updated_at", "2016-02-19 10:42:01.003470"]]
         
     | 
| 
      
 2910 
     | 
    
         
            +
              [1m[35m (0.9ms)[0m  commit transaction
         
     | 
| 
      
 2911 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 2912 
     | 
    
         
            +
              [1m[35mPicture Exists (0.4ms)[0m  SELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = '0eo4f8NLHt0SK5bwpyFw' LIMIT 1
         
     | 
| 
      
 2913 
     | 
    
         
            +
              [1m[36mSQL (0.6ms)[0m  [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:42:01.015685"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "0eo4f8NLHt0SK5bwpyFw"], ["type", "Picture"], ["updated_at", "2016-02-19 10:42:01.015685"]]
         
     | 
| 
      
 2914 
     | 
    
         
            +
              [1m[35m (1.1ms)[0m  commit transaction
         
     | 
| 
      
 2915 
     | 
    
         
            +
            Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-02-19 12:42:01 +0200
         
     | 
| 
      
 2916 
     | 
    
         
            +
              [1m[36mPicture Load (0.2ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'wrong'  ORDER BY "assets"."id" ASC LIMIT 1[0m
         
     | 
| 
      
 2917 
     | 
    
         
            +
            Started POST "/uploader/attachments" for 127.0.0.1 at 2016-02-19 12:42:01 +0200
         
     | 
| 
      
 2918 
     | 
    
         
            +
              [1m[35m (1.1ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 2919 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 2920 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 2921 
     | 
    
         
            +
              [1m[36m (0.7ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 2922 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 2923 
     | 
    
         
            +
              [1m[36m (0.9ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 2924 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2925 
     | 
    
         
            +
            Started POST "/uploader/attachments" for 127.0.0.1 at 2016-02-19 12:42:30 +0200
         
     | 
| 
      
 2926 
     | 
    
         
            +
              [1m[35m (0.2ms)[0m  begin transaction
         
     | 
| 
      
 2927 
     | 
    
         
            +
              [1m[36mPicture Exists (0.4ms)[0m  [1mSELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'yW3Ss1OcqwtM57XLrUKQ' LIMIT 1[0m
         
     | 
| 
      
 2928 
     | 
    
         
            +
              [1m[35mSQL (1.6ms)[0m  INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:42:30.372910"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["public_token", "yW3Ss1OcqwtM57XLrUKQ"], ["type", "Picture"], ["updated_at", "2016-02-19 10:42:30.372910"]]
         
     | 
| 
      
 2929 
     | 
    
         
            +
              [1m[36m (0.8ms)[0m  [1mcommit transaction[0m
         
     | 
| 
      
 2930 
     | 
    
         
            +
              [1m[35m (0.2ms)[0m  begin transaction
         
     | 
| 
      
 2931 
     | 
    
         
            +
              [1m[36mSQL (1.3ms)[0m  [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m  [["content", "MyText"], ["created_at", "2016-02-19 10:42:30.466423"], ["title", "MyString"], ["updated_at", "2016-02-19 10:42:30.466423"]]
         
     | 
| 
      
 2932 
     | 
    
         
            +
              [1m[35m (9.0ms)[0m  commit transaction
         
     | 
| 
      
 2933 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 2934 
     | 
    
         
            +
              [1m[35mPicture Exists (0.2ms)[0m  SELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'POeizRav9l81GDrYKe7R' LIMIT 1
         
     | 
| 
      
 2935 
     | 
    
         
            +
              [1m[36mSQL (0.9ms)[0m  [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:42:30.515566"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "POeizRav9l81GDrYKe7R"], ["type", "Picture"], ["updated_at", "2016-02-19 10:42:30.515566"]]
         
     | 
| 
      
 2936 
     | 
    
         
            +
              [1m[35m (0.7ms)[0m  commit transaction
         
     | 
| 
      
 2937 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT COUNT(*) FROM "assets"  WHERE "assets"."type" IN ('Picture')[0m
         
     | 
| 
      
 2938 
     | 
    
         
            +
            Started DELETE "/uploader/attachments/POeizRav9l81GDrYKe7R" for 127.0.0.1 at 2016-02-19 12:42:30 +0200
         
     | 
| 
      
 2939 
     | 
    
         
            +
              [1m[35mPicture Load (0.3ms)[0m  SELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'POeizRav9l81GDrYKe7R'  ORDER BY "assets"."id" ASC LIMIT 1
         
     | 
| 
      
 2940 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 2941 
     | 
    
         
            +
              [1m[35mSQL (0.4ms)[0m  DELETE FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ?  [["id", 2]]
         
     | 
| 
      
 2942 
     | 
    
         
            +
              [1m[36m (0.8ms)[0m  [1mcommit transaction[0m
         
     | 
| 
      
 2943 
     | 
    
         
            +
              [1m[35m (0.2ms)[0m  SELECT COUNT(*) FROM "assets"  WHERE "assets"."type" IN ('Picture')
         
     | 
| 
      
 2944 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 2945 
     | 
    
         
            +
              [1m[35mSQL (0.4ms)[0m  INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)  [["content", "MyText"], ["created_at", "2016-02-19 10:42:30.595708"], ["title", "MyString"], ["updated_at", "2016-02-19 10:42:30.595708"]]
         
     | 
| 
      
 2946 
     | 
    
         
            +
              [1m[36m (0.9ms)[0m  [1mcommit transaction[0m
         
     | 
| 
      
 2947 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
      
 2948 
     | 
    
         
            +
              [1m[36mPicture Exists (0.2ms)[0m  [1mSELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'PAZMiwhkz1jMZPvOyb9x' LIMIT 1[0m
         
     | 
| 
      
 2949 
     | 
    
         
            +
              [1m[35mSQL (0.3ms)[0m  INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)  [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:42:30.599987"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "PAZMiwhkz1jMZPvOyb9x"], ["type", "Picture"], ["updated_at", "2016-02-19 10:42:30.599987"]]
         
     | 
| 
      
 2950 
     | 
    
         
            +
              [1m[36m (0.8ms)[0m  [1mcommit transaction[0m
         
     | 
| 
      
 2951 
     | 
    
         
            +
            Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-02-19 12:42:30 +0200
         
     | 
| 
      
 2952 
     | 
    
         
            +
              [1m[35mPicture Load (0.3ms)[0m  SELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'wrong'  ORDER BY "assets"."id" ASC LIMIT 1
         
     | 
| 
      
 2953 
     | 
    
         
            +
            Started POST "/uploader/attachments" for 127.0.0.1 at 2016-02-19 12:42:30 +0200
         
     | 
| 
      
 2954 
     | 
    
         
            +
              [1m[36m (1.2ms)[0m  [1mDELETE FROM "assets";[0m
         
     | 
| 
      
 2955 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 2956 
     | 
    
         
            +
              [1m[36m (0.7ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'assets';[0m
         
     | 
| 
      
 2957 
     | 
    
         
            +
              [1m[35m (0.9ms)[0m  DELETE FROM "articles";
         
     | 
| 
      
 2958 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 2959 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  DELETE FROM sqlite_sequence where name = 'articles';
         
     | 
| 
      
 2960 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.7ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2961 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2962 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2963 
     | 
    
         
            +
              [1m[35m (2.8ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 2964 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 2965 
     | 
    
         
            +
              [1m[35m (0.5ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 2966 
     | 
    
         
            +
              [1m[36m (1.4ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 2967 
     | 
    
         
            +
              [1m[35m (0.2ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 2968 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 2969 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2970 
     | 
    
         
            +
              [1m[35m (2.3ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 2971 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 2972 
     | 
    
         
            +
              [1m[35m (0.5ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 2973 
     | 
    
         
            +
              [1m[36m (1.2ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 2974 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 2975 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 2976 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2977 
     | 
    
         
            +
              [1m[35m (2.6ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 2978 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 2979 
     | 
    
         
            +
              [1m[35m (0.5ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 2980 
     | 
    
         
            +
              [1m[36m (1.2ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 2981 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 2982 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 2983 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2984 
     | 
    
         
            +
              [1m[35m (1.3ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 2985 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 2986 
     | 
    
         
            +
              [1m[35m (0.5ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 2987 
     | 
    
         
            +
              [1m[36m (1.0ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 2988 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 2989 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 2990 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2991 
     | 
    
         
            +
              [1m[35m (1.4ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 2992 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 2993 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 2994 
     | 
    
         
            +
              [1m[36m (1.0ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 2995 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 2996 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 2997 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 2998 
     | 
    
         
            +
              [1m[35m (1.4ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 2999 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3000 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 3001 
     | 
    
         
            +
              [1m[36m (0.8ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 3002 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3003 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 3004 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3005 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
      
 3006 
     | 
    
         
            +
              [1m[36mSQL (0.5ms)[0m  [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m  [["content", "MyText"], ["created_at", "2016-02-19 10:47:58.842895"], ["title", "MyString"], ["updated_at", "2016-02-19 10:47:58.842895"]]
         
     | 
| 
      
 3007 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  commit transaction
         
     | 
| 
      
 3008 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 3009 
     | 
    
         
            +
              [1m[35mPicture Exists (0.3ms)[0m  SELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'PyYDPgwxXibU5iebwvyT' LIMIT 1
         
     | 
| 
      
 3010 
     | 
    
         
            +
              [1m[36mSQL (0.4ms)[0m  [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:47:58.853151"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "PyYDPgwxXibU5iebwvyT"], ["type", "Picture"], ["updated_at", "2016-02-19 10:47:58.853151"]]
         
     | 
| 
      
 3011 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  commit transaction
         
     | 
| 
      
 3012 
     | 
    
         
            +
              [1m[36mPicture Load (0.3ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'  ORDER BY "assets"."id" ASC LIMIT 1[0m
         
     | 
| 
      
 3013 
     | 
    
         
            +
              [1m[35mSQL (1.1ms)[0m  UPDATE "assets" SET "assetable_id" = 1000, "guid" = NULL WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'
         
     | 
| 
      
 3014 
     | 
    
         
            +
              [1m[36mPicture Load (0.2ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? LIMIT 1[0m  [["id", 1]]
         
     | 
| 
      
 3015 
     | 
    
         
            +
              [1m[35m (1.0ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 3016 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3017 
     | 
    
         
            +
              [1m[35m (0.9ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 3018 
     | 
    
         
            +
              [1m[36m (0.7ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 3019 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3020 
     | 
    
         
            +
              [1m[36m (0.9ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 3021 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3022 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
      
 3023 
     | 
    
         
            +
              [1m[36mSQL (1.3ms)[0m  [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m  [["content", "MyText"], ["created_at", "2016-02-19 10:48:45.357911"], ["title", "MyString"], ["updated_at", "2016-02-19 10:48:45.357911"]]
         
     | 
| 
      
 3024 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  commit transaction
         
     | 
| 
      
 3025 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 3026 
     | 
    
         
            +
              [1m[35mPicture Exists (0.6ms)[0m  SELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'Ug2WHhK2fKyetxUgA5Ru' LIMIT 1
         
     | 
| 
      
 3027 
     | 
    
         
            +
              [1m[36mSQL (1.7ms)[0m  [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:48:45.369731"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "Ug2WHhK2fKyetxUgA5Ru"], ["type", "Picture"], ["updated_at", "2016-02-19 10:48:45.369731"]]
         
     | 
| 
      
 3028 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  commit transaction
         
     | 
| 
      
 3029 
     | 
    
         
            +
              [1m[36mPicture Load (0.3ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'  ORDER BY "assets"."id" ASC LIMIT 1[0m
         
     | 
| 
      
 3030 
     | 
    
         
            +
              [1m[35mSQL (1.1ms)[0m  UPDATE "assets" SET "assetable_id" = 1000, "guid" = NULL WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'
         
     | 
| 
      
 3031 
     | 
    
         
            +
              [1m[36mPicture Load (0.2ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? LIMIT 1[0m  [["id", 1]]
         
     | 
| 
      
 3032 
     | 
    
         
            +
              [1m[35mPicture Load (0.3ms)[0m  SELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."guid" = 'OsjMNcX47yDKobKKKqEE' AND "assets"."assetable_type" = 'Article'  ORDER BY "assets"."id" ASC LIMIT 1
         
     | 
| 
      
 3033 
     | 
    
         
            +
              [1m[36m (1.2ms)[0m  [1mDELETE FROM "assets";[0m
         
     | 
| 
      
 3034 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3035 
     | 
    
         
            +
              [1m[36m (1.0ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'assets';[0m
         
     | 
| 
      
 3036 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  DELETE FROM "articles";
         
     | 
| 
      
 3037 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3038 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  DELETE FROM sqlite_sequence where name = 'articles';
         
     | 
| 
      
 3039 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3040 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3041 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3042 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3043 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3044 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3045 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3046 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3047 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
      
 3048 
     | 
    
         
            +
              [1m[36mSQL (1.3ms)[0m  [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m  [["content", "MyText"], ["created_at", "2016-02-19 10:55:27.336912"], ["title", "MyString"], ["updated_at", "2016-02-19 10:55:27.336912"]]
         
     | 
| 
      
 3049 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  commit transaction
         
     | 
| 
      
 3050 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 3051 
     | 
    
         
            +
              [1m[35mPicture Exists (0.7ms)[0m  SELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'FnvHlFpNIhxXucfU9hjH' LIMIT 1
         
     | 
| 
      
 3052 
     | 
    
         
            +
              [1m[36mSQL (1.8ms)[0m  [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:55:27.349889"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "FnvHlFpNIhxXucfU9hjH"], ["type", "Picture"], ["updated_at", "2016-02-19 10:55:27.349889"]]
         
     | 
| 
      
 3053 
     | 
    
         
            +
              [1m[35m (0.9ms)[0m  commit transaction
         
     | 
| 
      
 3054 
     | 
    
         
            +
              [1m[36mPicture Load (0.7ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'  ORDER BY "assets"."id" ASC LIMIT 1[0m
         
     | 
| 
      
 3055 
     | 
    
         
            +
              [1m[35mSQL (1.3ms)[0m  UPDATE "assets" SET "assetable_id" = 1000, "guid" = NULL WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'
         
     | 
| 
      
 3056 
     | 
    
         
            +
              [1m[36mPicture Load (0.2ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? LIMIT 1[0m  [["id", 1]]
         
     | 
| 
      
 3057 
     | 
    
         
            +
              [1m[35mPicture Load (0.3ms)[0m  SELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."guid" = 'ynxazZOJmFvcsnPO6Spz' AND "assets"."assetable_type" = 'Article'  ORDER BY "assets"."id" ASC LIMIT 1
         
     | 
| 
      
 3058 
     | 
    
         
            +
              [1m[36m (3.8ms)[0m  [1mDELETE FROM "assets";[0m
         
     | 
| 
      
 3059 
     | 
    
         
            +
              [1m[35m (0.3ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3060 
     | 
    
         
            +
              [1m[36m (6.8ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'assets';[0m
         
     | 
| 
      
 3061 
     | 
    
         
            +
              [1m[35m (1.1ms)[0m  DELETE FROM "articles";
         
     | 
| 
      
 3062 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3063 
     | 
    
         
            +
              [1m[35m (0.9ms)[0m  DELETE FROM sqlite_sequence where name = 'articles';
         
     | 
| 
      
 3064 
     | 
    
         
            +
              [1m[36m (1.2ms)[0m  [1mDELETE FROM "assets";[0m
         
     | 
| 
      
 3065 
     | 
    
         
            +
              [1m[35m (0.2ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3066 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'assets';[0m
         
     | 
| 
      
 3067 
     | 
    
         
            +
              [1m[35m (1.0ms)[0m  DELETE FROM "articles";
         
     | 
| 
      
 3068 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3069 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  DELETE FROM sqlite_sequence where name = 'articles';
         
     | 
| 
      
 3070 
     | 
    
         
            +
            Started POST "/uploader/attachments" for 127.0.0.1 at 2016-02-19 12:55:28 +0200
         
     | 
| 
      
 3071 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 3072 
     | 
    
         
            +
              [1m[35mPicture Exists (0.2ms)[0m  SELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'uvaCspoK4p0xCxTKfn0f' LIMIT 1
         
     | 
| 
      
 3073 
     | 
    
         
            +
              [1m[36mSQL (0.4ms)[0m  [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:55:28.105561"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["public_token", "uvaCspoK4p0xCxTKfn0f"], ["type", "Picture"], ["updated_at", "2016-02-19 10:55:28.105561"]]
         
     | 
| 
      
 3074 
     | 
    
         
            +
              [1m[35m (1.1ms)[0m  commit transaction
         
     | 
| 
      
 3075 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 3076 
     | 
    
         
            +
              [1m[35mSQL (0.3ms)[0m  INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)  [["content", "MyText"], ["created_at", "2016-02-19 10:55:28.181348"], ["title", "MyString"], ["updated_at", "2016-02-19 10:55:28.181348"]]
         
     | 
| 
      
 3077 
     | 
    
         
            +
              [1m[36m (0.9ms)[0m  [1mcommit transaction[0m
         
     | 
| 
      
 3078 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
      
 3079 
     | 
    
         
            +
              [1m[36mPicture Exists (0.2ms)[0m  [1mSELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'bYoSV4vKkPX11bI4yh95' LIMIT 1[0m
         
     | 
| 
      
 3080 
     | 
    
         
            +
              [1m[35mSQL (0.3ms)[0m  INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:55:28.185905"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "bYoSV4vKkPX11bI4yh95"], ["type", "Picture"], ["updated_at", "2016-02-19 10:55:28.185905"]]
         
     | 
| 
      
 3081 
     | 
    
         
            +
              [1m[36m (0.8ms)[0m  [1mcommit transaction[0m
         
     | 
| 
      
 3082 
     | 
    
         
            +
              [1m[35m (0.2ms)[0m  SELECT COUNT(*) FROM "assets"  WHERE "assets"."type" IN ('Picture')
         
     | 
| 
      
 3083 
     | 
    
         
            +
            Started DELETE "/uploader/attachments/bYoSV4vKkPX11bI4yh95" for 127.0.0.1 at 2016-02-19 12:55:28 +0200
         
     | 
| 
      
 3084 
     | 
    
         
            +
              [1m[36mPicture Load (0.2ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'bYoSV4vKkPX11bI4yh95'  ORDER BY "assets"."id" ASC LIMIT 1[0m
         
     | 
| 
      
 3085 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
      
 3086 
     | 
    
         
            +
              [1m[36mSQL (0.3ms)[0m  [1mDELETE FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ?[0m  [["id", 2]]
         
     | 
| 
      
 3087 
     | 
    
         
            +
              [1m[35m (1.6ms)[0m  commit transaction
         
     | 
| 
      
 3088 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT COUNT(*) FROM "assets"  WHERE "assets"."type" IN ('Picture')[0m
         
     | 
| 
      
 3089 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
      
 3090 
     | 
    
         
            +
              [1m[36mSQL (0.3ms)[0m  [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m  [["content", "MyText"], ["created_at", "2016-02-19 10:55:28.254449"], ["title", "MyString"], ["updated_at", "2016-02-19 10:55:28.254449"]]
         
     | 
| 
      
 3091 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  commit transaction
         
     | 
| 
      
 3092 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 3093 
     | 
    
         
            +
              [1m[35mPicture Exists (0.2ms)[0m  SELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'KGveJ86llLfSsFiYfZBI' LIMIT 1
         
     | 
| 
      
 3094 
     | 
    
         
            +
              [1m[36mSQL (0.3ms)[0m  [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m  [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:55:28.258544"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "KGveJ86llLfSsFiYfZBI"], ["type", "Picture"], ["updated_at", "2016-02-19 10:55:28.258544"]]
         
     | 
| 
      
 3095 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  commit transaction
         
     | 
| 
      
 3096 
     | 
    
         
            +
            Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-02-19 12:55:28 +0200
         
     | 
| 
      
 3097 
     | 
    
         
            +
              [1m[36mPicture Load (0.2ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'wrong'  ORDER BY "assets"."id" ASC LIMIT 1[0m
         
     | 
| 
      
 3098 
     | 
    
         
            +
            Started POST "/uploader/attachments" for 127.0.0.1 at 2016-02-19 12:55:28 +0200
         
     | 
| 
      
 3099 
     | 
    
         
            +
              [1m[35m (1.3ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 3100 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3101 
     | 
    
         
            +
              [1m[35m (0.9ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 3102 
     | 
    
         
            +
              [1m[36m (1.4ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 3103 
     | 
    
         
            +
              [1m[35m (0.2ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3104 
     | 
    
         
            +
              [1m[36m (1.0ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 3105 
     | 
    
         
            +
              [1m[35m (1.1ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 3106 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3107 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 3108 
     | 
    
         
            +
              [1m[36m (0.8ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 3109 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3110 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 3111 
     | 
    
         
            +
              [1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m  [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
         
     | 
| 
      
 3112 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
      
 3113 
     | 
    
         
            +
              [1m[36mSQL (0.5ms)[0m  [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m  [["content", "MyText"], ["created_at", "2016-02-19 10:55:35.721670"], ["title", "MyString"], ["updated_at", "2016-02-19 10:55:35.721670"]]
         
     | 
| 
      
 3114 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  commit transaction
         
     | 
| 
      
 3115 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 3116 
     | 
    
         
            +
              [1m[35mPicture Exists (0.2ms)[0m  SELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'HiROxaE0uS82ywQrM1bB' LIMIT 1
         
     | 
| 
      
 3117 
     | 
    
         
            +
              [1m[36mSQL (0.4ms)[0m  [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:55:35.732535"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "HiROxaE0uS82ywQrM1bB"], ["type", "Picture"], ["updated_at", "2016-02-19 10:55:35.732535"]]
         
     | 
| 
      
 3118 
     | 
    
         
            +
              [1m[35m (0.9ms)[0m  commit transaction
         
     | 
| 
      
 3119 
     | 
    
         
            +
              [1m[36mPicture Load (0.5ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'  ORDER BY "assets"."id" ASC LIMIT 1[0m
         
     | 
| 
      
 3120 
     | 
    
         
            +
              [1m[35mSQL (1.1ms)[0m  UPDATE "assets" SET "assetable_id" = 1000, "guid" = NULL WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'
         
     | 
| 
      
 3121 
     | 
    
         
            +
              [1m[36mPicture Load (0.2ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? LIMIT 1[0m  [["id", 1]]
         
     | 
| 
      
 3122 
     | 
    
         
            +
              [1m[35mPicture Load (0.3ms)[0m  SELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."guid" = 'O1YZnsLfnUVMybkjpN7e' AND "assets"."assetable_type" = 'Article'  ORDER BY "assets"."id" ASC LIMIT 1
         
     | 
| 
      
 3123 
     | 
    
         
            +
              [1m[36m (1.1ms)[0m  [1mDELETE FROM "assets";[0m
         
     | 
| 
      
 3124 
     | 
    
         
            +
              [1m[35m (0.3ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3125 
     | 
    
         
            +
              [1m[36m (0.9ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'assets';[0m
         
     | 
| 
      
 3126 
     | 
    
         
            +
              [1m[35m (0.8ms)[0m  DELETE FROM "articles";
         
     | 
| 
      
 3127 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3128 
     | 
    
         
            +
              [1m[35m (1.0ms)[0m  DELETE FROM sqlite_sequence where name = 'articles';
         
     | 
| 
      
 3129 
     | 
    
         
            +
              [1m[36m (1.1ms)[0m  [1mDELETE FROM "assets";[0m
         
     | 
| 
      
 3130 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3131 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'assets';[0m
         
     | 
| 
      
 3132 
     | 
    
         
            +
              [1m[35m (0.9ms)[0m  DELETE FROM "articles";
         
     | 
| 
      
 3133 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3134 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  DELETE FROM sqlite_sequence where name = 'articles';
         
     | 
| 
      
 3135 
     | 
    
         
            +
            Started POST "/uploader/attachments" for 127.0.0.1 at 2016-02-19 12:55:35 +0200
         
     | 
| 
      
 3136 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 3137 
     | 
    
         
            +
              [1m[35mPicture Exists (0.4ms)[0m  SELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'j9im6FlvUTOFF4GFapxl' LIMIT 1
         
     | 
| 
      
 3138 
     | 
    
         
            +
              [1m[36mSQL (0.4ms)[0m  [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_file_name", "guid", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:55:35.905689"], ["data_file_name", "rails.png"], ["guid", "SOMESTRING"], ["public_token", "j9im6FlvUTOFF4GFapxl"], ["type", "Picture"], ["updated_at", "2016-02-19 10:55:35.905689"]]
         
     | 
| 
      
 3139 
     | 
    
         
            +
              [1m[35m (1.0ms)[0m  commit transaction
         
     | 
| 
      
 3140 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 3141 
     | 
    
         
            +
              [1m[35mSQL (0.3ms)[0m  INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)  [["content", "MyText"], ["created_at", "2016-02-19 10:55:35.979833"], ["title", "MyString"], ["updated_at", "2016-02-19 10:55:35.979833"]]
         
     | 
| 
      
 3142 
     | 
    
         
            +
              [1m[36m (0.9ms)[0m  [1mcommit transaction[0m
         
     | 
| 
      
 3143 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
      
 3144 
     | 
    
         
            +
              [1m[36mPicture Exists (0.2ms)[0m  [1mSELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'xs9Vi2ChWVPM1BGWgTqm' LIMIT 1[0m
         
     | 
| 
      
 3145 
     | 
    
         
            +
              [1m[35mSQL (0.3ms)[0m  INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)  [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:55:35.983474"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "xs9Vi2ChWVPM1BGWgTqm"], ["type", "Picture"], ["updated_at", "2016-02-19 10:55:35.983474"]]
         
     | 
| 
      
 3146 
     | 
    
         
            +
              [1m[36m (1.0ms)[0m  [1mcommit transaction[0m
         
     | 
| 
      
 3147 
     | 
    
         
            +
              [1m[35m (0.3ms)[0m  SELECT COUNT(*) FROM "assets"  WHERE "assets"."type" IN ('Picture')
         
     | 
| 
      
 3148 
     | 
    
         
            +
            Started DELETE "/uploader/attachments/xs9Vi2ChWVPM1BGWgTqm" for 127.0.0.1 at 2016-02-19 12:55:35 +0200
         
     | 
| 
      
 3149 
     | 
    
         
            +
              [1m[36mPicture Load (0.2ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'xs9Vi2ChWVPM1BGWgTqm'  ORDER BY "assets"."id" ASC LIMIT 1[0m
         
     | 
| 
      
 3150 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  begin transaction
         
     | 
| 
      
 3151 
     | 
    
         
            +
              [1m[36mSQL (0.3ms)[0m  [1mDELETE FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ?[0m  [["id", 2]]
         
     | 
| 
      
 3152 
     | 
    
         
            +
              [1m[35m (0.9ms)[0m  commit transaction
         
     | 
| 
      
 3153 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT COUNT(*) FROM "assets"  WHERE "assets"."type" IN ('Picture')[0m
         
     | 
| 
      
 3154 
     | 
    
         
            +
              [1m[35m (0.2ms)[0m  begin transaction
         
     | 
| 
      
 3155 
     | 
    
         
            +
              [1m[36mSQL (0.4ms)[0m  [1mINSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?)[0m  [["content", "MyText"], ["created_at", "2016-02-19 10:55:36.051689"], ["title", "MyString"], ["updated_at", "2016-02-19 10:55:36.051689"]]
         
     | 
| 
      
 3156 
     | 
    
         
            +
              [1m[35m (2.1ms)[0m  commit transaction
         
     | 
| 
      
 3157 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mbegin transaction[0m
         
     | 
| 
      
 3158 
     | 
    
         
            +
              [1m[35mPicture Exists (0.2ms)[0m  SELECT  1 AS one FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = '38sk1CwyEyMgItShzY0o' LIMIT 1
         
     | 
| 
      
 3159 
     | 
    
         
            +
              [1m[36mSQL (0.3ms)[0m  [1mINSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "public_token", "type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m  [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", "2016-02-19 10:55:36.058434"], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["public_token", "38sk1CwyEyMgItShzY0o"], ["type", "Picture"], ["updated_at", "2016-02-19 10:55:36.058434"]]
         
     | 
| 
      
 3160 
     | 
    
         
            +
              [1m[35m (0.9ms)[0m  commit transaction
         
     | 
| 
      
 3161 
     | 
    
         
            +
            Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2016-02-19 12:55:36 +0200
         
     | 
| 
      
 3162 
     | 
    
         
            +
              [1m[36mPicture Load (0.2ms)[0m  [1mSELECT  "assets".* FROM "assets"  WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'wrong'  ORDER BY "assets"."id" ASC LIMIT 1[0m
         
     | 
| 
      
 3163 
     | 
    
         
            +
            Started POST "/uploader/attachments" for 127.0.0.1 at 2016-02-19 12:55:36 +0200
         
     | 
| 
      
 3164 
     | 
    
         
            +
              [1m[35m (1.3ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 3165 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3166 
     | 
    
         
            +
              [1m[35m (1.0ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 3167 
     | 
    
         
            +
              [1m[36m (0.8ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 3168 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3169 
     | 
    
         
            +
              [1m[36m (0.9ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
      
 3170 
     | 
    
         
            +
              [1m[35m (1.3ms)[0m  DELETE FROM "assets";
         
     | 
| 
      
 3171 
     | 
    
         
            +
              [1m[36m (0.2ms)[0m  [1mSELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';[0m
         
     | 
| 
      
 3172 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  DELETE FROM sqlite_sequence where name = 'assets';
         
     | 
| 
      
 3173 
     | 
    
         
            +
              [1m[36m (0.9ms)[0m  [1mDELETE FROM "articles";[0m
         
     | 
| 
      
 3174 
     | 
    
         
            +
              [1m[35m (0.1ms)[0m  SELECT name FROM sqlite_master WHERE type='table' AND name='sqlite_sequence';
         
     | 
| 
      
 3175 
     | 
    
         
            +
              [1m[36m (0.1ms)[0m  [1mDELETE FROM sqlite_sequence where name = 'articles';[0m
         
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
| 
         Binary file 
     | 
    
        data/spec/mongoid.yml
    CHANGED
    
    | 
         @@ -1,17 +1,12 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # Tell Mongoid which environment this configuration is for.
         
     | 
| 
       2 
1 
     | 
    
         
             
            test:
         
     | 
| 
       3 
     | 
    
         
            -
               
     | 
| 
       4 
     | 
    
         
            -
              # many sessions as you like, but you must have at least 1 named
         
     | 
| 
       5 
     | 
    
         
            -
              # 'default'.
         
     | 
| 
       6 
     | 
    
         
            -
              sessions:
         
     | 
| 
       7 
     | 
    
         
            -
                # Define the default session.
         
     | 
| 
      
 2 
     | 
    
         
            +
              clients:
         
     | 
| 
       8 
3 
     | 
    
         
             
                default:
         
     | 
| 
       9 
     | 
    
         
            -
                   
     | 
| 
       10 
     | 
    
         
            -
                  # server setup, and at least 3 for a replica set. Hosts must be
         
     | 
| 
       11 
     | 
    
         
            -
                  # an array of host:port pairs. This session is single server.
         
     | 
| 
      
 4 
     | 
    
         
            +
                  database: rails_uploader_test
         
     | 
| 
       12 
5 
     | 
    
         
             
                  hosts:
         
     | 
| 
       13 
6 
     | 
    
         
             
                    - localhost:27017
         
     | 
| 
       14 
     | 
    
         
            -
                   
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 7 
     | 
    
         
            +
                  options:
         
     | 
| 
      
 8 
     | 
    
         
            +
                    consistency: :strong
         
     | 
| 
      
 9 
     | 
    
         
            +
                    # In the test environment we lower the retries and retry interval to
         
     | 
| 
      
 10 
     | 
    
         
            +
                    # low amounts for fast failures.
         
     | 
| 
      
 11 
     | 
    
         
            +
                    max_retries: 1
         
     | 
| 
      
 12 
     | 
    
         
            +
                    retry_interval: 0
         
     | 
    
        data/spec/mongoid_spec.rb
    CHANGED
    
    
    
        data/spec/spec_helper.rb
    CHANGED
    
    | 
         @@ -1,24 +1,22 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Configure Rails Envinronment
         
     | 
| 
       2 
     | 
    
         
            -
            ENV[ 
     | 
| 
      
 2 
     | 
    
         
            +
            ENV['RAILS_ENV'] = 'test'
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
            require File.expand_path( 
     | 
| 
       5 
     | 
    
         
            -
            require  
     | 
| 
       6 
     | 
    
         
            -
            require "rspec/rails"
         
     | 
| 
       7 
     | 
    
         
            -
            require "database_cleaner"
         
     | 
| 
      
 4 
     | 
    
         
            +
            require File.expand_path('../dummy/config/environment.rb', __FILE__)
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'database_cleaner'
         
     | 
| 
       8 
6 
     | 
    
         | 
| 
       9 
7 
     | 
    
         
             
            # Fixtures replacement with a straightforward definition syntax
         
     | 
| 
       10 
8 
     | 
    
         
             
            require 'factory_girl'
         
     | 
| 
       11 
     | 
    
         
            -
            FactoryGirl.definition_file_paths = [ 
     | 
| 
      
 9 
     | 
    
         
            +
            FactoryGirl.definition_file_paths = [File.expand_path('../factories/', __FILE__)]
         
     | 
| 
       12 
10 
     | 
    
         
             
            FactoryGirl.find_definitions
         
     | 
| 
       13 
11 
     | 
    
         | 
| 
       14 
12 
     | 
    
         
             
            ActionMailer::Base.delivery_method = :test
         
     | 
| 
       15 
13 
     | 
    
         
             
            ActionMailer::Base.perform_deliveries = true
         
     | 
| 
       16 
     | 
    
         
            -
            ActionMailer::Base.default_url_options[:host] =  
     | 
| 
      
 14 
     | 
    
         
            +
            ActionMailer::Base.default_url_options[:host] = 'test.com'
         
     | 
| 
       17 
15 
     | 
    
         | 
| 
       18 
16 
     | 
    
         
             
            Rails.backtrace_cleaner.remove_silencers!
         
     | 
| 
       19 
17 
     | 
    
         | 
| 
       20 
18 
     | 
    
         
             
            # Run any available migration
         
     | 
| 
       21 
     | 
    
         
            -
            ActiveRecord::Migrator.migrate File.expand_path( 
     | 
| 
      
 19 
     | 
    
         
            +
            ActiveRecord::Migrator.migrate File.expand_path('../dummy/db/migrate/', __FILE__)
         
     | 
| 
       22 
20 
     | 
    
         | 
| 
       23 
21 
     | 
    
         
             
            require 'carrierwave'
         
     | 
| 
       24 
22 
     | 
    
         
             
            CarrierWave.configure do |config|
         
     | 
| 
         @@ -29,10 +27,6 @@ end 
     | 
|
| 
       29 
27 
     | 
    
         
             
            # Load support files
         
     | 
| 
       30 
28 
     | 
    
         
             
            Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
         
     | 
| 
       31 
29 
     | 
    
         | 
| 
       32 
     | 
    
         
            -
            # Mongoid
         
     | 
| 
       33 
     | 
    
         
            -
            require 'mongoid'
         
     | 
| 
       34 
     | 
    
         
            -
            Mongoid.load!('spec/mongoid.yml')
         
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
30 
     | 
    
         
             
            RSpec.configure do |config|
         
     | 
| 
       37 
31 
     | 
    
         
             
              # Remove this line if you don't want RSpec's should and should_not
         
     | 
| 
       38 
32 
     | 
    
         
             
              # methods or matchers
         
     | 
| 
         @@ -41,19 +35,19 @@ RSpec.configure do |config| 
     | 
|
| 
       41 
35 
     | 
    
         | 
| 
       42 
36 
     | 
    
         
             
              # == Mock Framework
         
     | 
| 
       43 
37 
     | 
    
         
             
              config.mock_with :rspec
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
       45 
39 
     | 
    
         
             
              config.before(:suite) do
         
     | 
| 
       46 
40 
     | 
    
         
             
                DatabaseCleaner[:active_record].strategy = :truncation
         
     | 
| 
       47 
     | 
    
         
            -
                DatabaseCleaner[:mongoid].strategy = :truncation
         
     | 
| 
      
 41 
     | 
    
         
            +
                DatabaseCleaner[:mongoid].strategy = :truncation if Object.const_defined?('Mongoid')
         
     | 
| 
       48 
42 
     | 
    
         
             
              end
         
     | 
| 
       49 
43 
     | 
    
         | 
| 
       50 
44 
     | 
    
         
             
              config.before(:all) do
         
     | 
| 
       51 
45 
     | 
    
         
             
                DatabaseCleaner[:active_record].start
         
     | 
| 
       52 
     | 
    
         
            -
                DatabaseCleaner[:mongoid].start
         
     | 
| 
      
 46 
     | 
    
         
            +
                DatabaseCleaner[:mongoid].start if Object.const_defined?('Mongoid')
         
     | 
| 
       53 
47 
     | 
    
         
             
              end
         
     | 
| 
       54 
48 
     | 
    
         | 
| 
       55 
49 
     | 
    
         
             
              config.after(:all) do
         
     | 
| 
       56 
50 
     | 
    
         
             
                DatabaseCleaner[:active_record].clean
         
     | 
| 
       57 
     | 
    
         
            -
                DatabaseCleaner[:mongoid].clean
         
     | 
| 
      
 51 
     | 
    
         
            +
                DatabaseCleaner[:mongoid].clean if Object.const_defined?('Mongoid')
         
     | 
| 
       58 
52 
     | 
    
         
             
              end
         
     | 
| 
       59 
53 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: rails-uploader
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.8
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Igor Galeta
         
     | 
| 
         @@ -9,7 +9,7 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date:  
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2016-02-19 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: jquery-ui-rails
         
     | 
| 
         @@ -74,6 +74,9 @@ extensions: [] 
     | 
|
| 
       74 
74 
     | 
    
         
             
            extra_rdoc_files:
         
     | 
| 
       75 
75 
     | 
    
         
             
            - README.md
         
     | 
| 
       76 
76 
     | 
    
         
             
            files:
         
     | 
| 
      
 77 
     | 
    
         
            +
            - MIT-LICENSE
         
     | 
| 
      
 78 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 79 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
       77 
80 
     | 
    
         
             
            - app/assets/javascripts/uploader/application.js
         
     | 
| 
       78 
81 
     | 
    
         
             
            - app/assets/stylesheets/uploader/application.css
         
     | 
| 
       79 
82 
     | 
    
         
             
            - app/controllers/uploader/attachments_controller.rb
         
     | 
| 
         @@ -81,7 +84,12 @@ files: 
     | 
|
| 
       81 
84 
     | 
    
         
             
            - app/views/uploader/default/_download.html.erb
         
     | 
| 
       82 
85 
     | 
    
         
             
            - app/views/uploader/default/_sortable.html.erb
         
     | 
| 
       83 
86 
     | 
    
         
             
            - app/views/uploader/default/_upload.html.erb
         
     | 
| 
      
 87 
     | 
    
         
            +
            - config/locales/en.yml
         
     | 
| 
      
 88 
     | 
    
         
            +
            - config/locales/ru.yml
         
     | 
| 
      
 89 
     | 
    
         
            +
            - config/locales/uk.yml
         
     | 
| 
      
 90 
     | 
    
         
            +
            - config/routes.rb
         
     | 
| 
       84 
91 
     | 
    
         
             
            - lib/rails-uploader.rb
         
     | 
| 
      
 92 
     | 
    
         
            +
            - lib/uploader.rb
         
     | 
| 
       85 
93 
     | 
    
         
             
            - lib/uploader/asset.rb
         
     | 
| 
       86 
94 
     | 
    
         
             
            - lib/uploader/engine.rb
         
     | 
| 
       87 
95 
     | 
    
         
             
            - lib/uploader/fileuploads.rb
         
     | 
| 
         @@ -92,30 +100,8 @@ files: 
     | 
|
| 
       92 
100 
     | 
    
         
             
            - lib/uploader/hooks/formtastic.rb
         
     | 
| 
       93 
101 
     | 
    
         
             
            - lib/uploader/hooks/simple_form.rb
         
     | 
| 
       94 
102 
     | 
    
         
             
            - lib/uploader/version.rb
         
     | 
| 
       95 
     | 
    
         
            -
            -  
     | 
| 
       96 
     | 
    
         
            -
            -  
     | 
| 
       97 
     | 
    
         
            -
            - config/locales/ru.yml
         
     | 
| 
       98 
     | 
    
         
            -
            - config/locales/uk.yml
         
     | 
| 
       99 
     | 
    
         
            -
            - config/routes.rb
         
     | 
| 
       100 
     | 
    
         
            -
            - vendor/assets/images/uploader/but_del_tag2.png
         
     | 
| 
       101 
     | 
    
         
            -
            - vendor/assets/images/uploader/ico_attach.png
         
     | 
| 
       102 
     | 
    
         
            -
            - vendor/assets/images/uploader/preloader.gif
         
     | 
| 
       103 
     | 
    
         
            -
            - vendor/assets/images/uploader/progressBarFillBg.png
         
     | 
| 
       104 
     | 
    
         
            -
            - vendor/assets/javascripts/uploader/jquery.fileupload-fp.js
         
     | 
| 
       105 
     | 
    
         
            -
            - vendor/assets/javascripts/uploader/jquery.fileupload-ui.js
         
     | 
| 
       106 
     | 
    
         
            -
            - vendor/assets/javascripts/uploader/jquery.fileupload.js
         
     | 
| 
       107 
     | 
    
         
            -
            - vendor/assets/javascripts/uploader/jquery.iframe-transport.js
         
     | 
| 
       108 
     | 
    
         
            -
            - vendor/assets/javascripts/uploader/jquery.ui.widget.js
         
     | 
| 
       109 
     | 
    
         
            -
            - vendor/assets/javascripts/uploader/load-image.min.js
         
     | 
| 
       110 
     | 
    
         
            -
            - vendor/assets/javascripts/uploader/locales/en.js
         
     | 
| 
       111 
     | 
    
         
            -
            - vendor/assets/javascripts/uploader/locales/ru.js
         
     | 
| 
       112 
     | 
    
         
            -
            - vendor/assets/javascripts/uploader/locales/uk.js
         
     | 
| 
       113 
     | 
    
         
            -
            - vendor/assets/javascripts/uploader/tmpl.min.js
         
     | 
| 
       114 
     | 
    
         
            -
            - vendor/assets/stylesheets/uploader/default.css
         
     | 
| 
       115 
     | 
    
         
            -
            - vendor/assets/stylesheets/uploader/jquery.fileupload-ui.css
         
     | 
| 
       116 
     | 
    
         
            -
            - MIT-LICENSE
         
     | 
| 
       117 
     | 
    
         
            -
            - Rakefile
         
     | 
| 
       118 
     | 
    
         
            -
            - README.md
         
     | 
| 
      
 103 
     | 
    
         
            +
            - spec/dummy/README.rdoc
         
     | 
| 
      
 104 
     | 
    
         
            +
            - spec/dummy/Rakefile
         
     | 
| 
       119 
105 
     | 
    
         
             
            - spec/dummy/app/assets/javascripts/application.js
         
     | 
| 
       120 
106 
     | 
    
         
             
            - spec/dummy/app/assets/stylesheets/application.css
         
     | 
| 
       121 
107 
     | 
    
         
             
            - spec/dummy/app/controllers/application_controller.rb
         
     | 
| 
         @@ -125,6 +111,7 @@ files: 
     | 
|
| 
       125 
111 
     | 
    
         
             
            - spec/dummy/app/models/picture.rb
         
     | 
| 
       126 
112 
     | 
    
         
             
            - spec/dummy/app/uploaders/picture_uploader.rb
         
     | 
| 
       127 
113 
     | 
    
         
             
            - spec/dummy/app/views/layouts/application.html.erb
         
     | 
| 
      
 114 
     | 
    
         
            +
            - spec/dummy/config.ru
         
     | 
| 
       128 
115 
     | 
    
         
             
            - spec/dummy/config/application.rb
         
     | 
| 
       129 
116 
     | 
    
         
             
            - spec/dummy/config/boot.rb
         
     | 
| 
       130 
117 
     | 
    
         
             
            - spec/dummy/config/database.yml
         
     | 
| 
         @@ -140,7 +127,6 @@ files: 
     | 
|
| 
       140 
127 
     | 
    
         
             
            - spec/dummy/config/initializers/wrap_parameters.rb
         
     | 
| 
       141 
128 
     | 
    
         
             
            - spec/dummy/config/locales/en.yml
         
     | 
| 
       142 
129 
     | 
    
         
             
            - spec/dummy/config/routes.rb
         
     | 
| 
       143 
     | 
    
         
            -
            - spec/dummy/config.ru
         
     | 
| 
       144 
130 
     | 
    
         
             
            - spec/dummy/db/migrate/20120508093416_create_assets.rb
         
     | 
| 
       145 
131 
     | 
    
         
             
            - spec/dummy/db/migrate/20120508093830_create_articles.rb
         
     | 
| 
       146 
132 
     | 
    
         
             
            - spec/dummy/db/test.sqlite3
         
     | 
| 
         @@ -153,6 +139,8 @@ files: 
     | 
|
| 
       153 
139 
     | 
    
         
             
            - spec/dummy/public/uploads/picture/data/1/thumb_rails.png
         
     | 
| 
       154 
140 
     | 
    
         
             
            - spec/dummy/public/uploads/picture/data/3/rails.png
         
     | 
| 
       155 
141 
     | 
    
         
             
            - spec/dummy/public/uploads/picture/data/3/thumb_rails.png
         
     | 
| 
      
 142 
     | 
    
         
            +
            - spec/dummy/public/uploads/tmp/1455878520-6456-6895/rails.png
         
     | 
| 
      
 143 
     | 
    
         
            +
            - spec/dummy/public/uploads/tmp/1455878520-6456-6895/thumb_rails.png
         
     | 
| 
       156 
144 
     | 
    
         
             
            - spec/dummy/public/uploads/tmp/20130905-1539-33540-9729/rails.png
         
     | 
| 
       157 
145 
     | 
    
         
             
            - spec/dummy/public/uploads/tmp/20130905-1539-33540-9729/thumb_rails.png
         
     | 
| 
       158 
146 
     | 
    
         
             
            - spec/dummy/public/uploads/tmp/20130905-1542-33540-2188/rails.png
         
     | 
| 
         @@ -169,8 +157,6 @@ files: 
     | 
|
| 
       169 
157 
     | 
    
         
             
            - spec/dummy/public/uploads/tmp/20130905-1726-34214-5471/thumb_rails.png
         
     | 
| 
       170 
158 
     | 
    
         
             
            - spec/dummy/public/uploads/tmp/20130905-1726-34214-9281/rails.png
         
     | 
| 
       171 
159 
     | 
    
         
             
            - spec/dummy/public/uploads/tmp/20130905-1726-34214-9281/thumb_rails.png
         
     | 
| 
       172 
     | 
    
         
            -
            - spec/dummy/Rakefile
         
     | 
| 
       173 
     | 
    
         
            -
            - spec/dummy/README.rdoc
         
     | 
| 
       174 
160 
     | 
    
         
             
            - spec/dummy/script/rails
         
     | 
| 
       175 
161 
     | 
    
         
             
            - spec/factories/articles.rb
         
     | 
| 
       176 
162 
     | 
    
         
             
            - spec/factories/assets.rb
         
     | 
| 
         @@ -181,6 +167,22 @@ files: 
     | 
|
| 
       181 
167 
     | 
    
         
             
            - spec/requests/attachments_controller_spec.rb
         
     | 
| 
       182 
168 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
       183 
169 
     | 
    
         
             
            - spec/uploader_spec.rb
         
     | 
| 
      
 170 
     | 
    
         
            +
            - vendor/assets/images/uploader/but_del_tag2.png
         
     | 
| 
      
 171 
     | 
    
         
            +
            - vendor/assets/images/uploader/ico_attach.png
         
     | 
| 
      
 172 
     | 
    
         
            +
            - vendor/assets/images/uploader/preloader.gif
         
     | 
| 
      
 173 
     | 
    
         
            +
            - vendor/assets/images/uploader/progressBarFillBg.png
         
     | 
| 
      
 174 
     | 
    
         
            +
            - vendor/assets/javascripts/uploader/jquery.fileupload-fp.js
         
     | 
| 
      
 175 
     | 
    
         
            +
            - vendor/assets/javascripts/uploader/jquery.fileupload-ui.js
         
     | 
| 
      
 176 
     | 
    
         
            +
            - vendor/assets/javascripts/uploader/jquery.fileupload.js
         
     | 
| 
      
 177 
     | 
    
         
            +
            - vendor/assets/javascripts/uploader/jquery.iframe-transport.js
         
     | 
| 
      
 178 
     | 
    
         
            +
            - vendor/assets/javascripts/uploader/jquery.ui.widget.js
         
     | 
| 
      
 179 
     | 
    
         
            +
            - vendor/assets/javascripts/uploader/load-image.min.js
         
     | 
| 
      
 180 
     | 
    
         
            +
            - vendor/assets/javascripts/uploader/locales/en.js
         
     | 
| 
      
 181 
     | 
    
         
            +
            - vendor/assets/javascripts/uploader/locales/ru.js
         
     | 
| 
      
 182 
     | 
    
         
            +
            - vendor/assets/javascripts/uploader/locales/uk.js
         
     | 
| 
      
 183 
     | 
    
         
            +
            - vendor/assets/javascripts/uploader/tmpl.min.js
         
     | 
| 
      
 184 
     | 
    
         
            +
            - vendor/assets/stylesheets/uploader/default.css
         
     | 
| 
      
 185 
     | 
    
         
            +
            - vendor/assets/stylesheets/uploader/jquery.fileupload-ui.css
         
     | 
| 
       184 
186 
     | 
    
         
             
            homepage: https://github.com/superp/rails-uploader
         
     | 
| 
       185 
187 
     | 
    
         
             
            licenses: []
         
     | 
| 
       186 
188 
     | 
    
         
             
            metadata: {}
         
     | 
| 
         @@ -200,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       200 
202 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       201 
203 
     | 
    
         
             
            requirements: []
         
     | 
| 
       202 
204 
     | 
    
         
             
            rubyforge_project: rails-uploader
         
     | 
| 
       203 
     | 
    
         
            -
            rubygems_version: 2. 
     | 
| 
      
 205 
     | 
    
         
            +
            rubygems_version: 2.4.8
         
     | 
| 
       204 
206 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       205 
207 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       206 
208 
     | 
    
         
             
            summary: Rails file upload implementation with jQuery-File-Upload
         
     | 
| 
         @@ -242,6 +244,8 @@ test_files: 
     | 
|
| 
       242 
244 
     | 
    
         
             
            - spec/dummy/public/uploads/picture/data/1/thumb_rails.png
         
     | 
| 
       243 
245 
     | 
    
         
             
            - spec/dummy/public/uploads/picture/data/3/rails.png
         
     | 
| 
       244 
246 
     | 
    
         
             
            - spec/dummy/public/uploads/picture/data/3/thumb_rails.png
         
     | 
| 
      
 247 
     | 
    
         
            +
            - spec/dummy/public/uploads/tmp/1455878520-6456-6895/rails.png
         
     | 
| 
      
 248 
     | 
    
         
            +
            - spec/dummy/public/uploads/tmp/1455878520-6456-6895/thumb_rails.png
         
     | 
| 
       245 
249 
     | 
    
         
             
            - spec/dummy/public/uploads/tmp/20130905-1539-33540-9729/rails.png
         
     | 
| 
       246 
250 
     | 
    
         
             
            - spec/dummy/public/uploads/tmp/20130905-1539-33540-9729/thumb_rails.png
         
     | 
| 
       247 
251 
     | 
    
         
             
            - spec/dummy/public/uploads/tmp/20130905-1542-33540-2188/rails.png
         
     |