rails-uploader 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9f68c0b656b627bdacf2628989d73b63c31647a
4
- data.tar.gz: 9c4d638cb6b89af40cf599e3c3f7aef950239d79
3
+ metadata.gz: cc96a9340a601b0b4b543c19d1dbd91ba2e7eca4
4
+ data.tar.gz: b8ad3626da4e00364cb2b8de3c11a4ffb52d6cc7
5
5
  SHA512:
6
- metadata.gz: 924193e248df81257e025613fff57b74b4f8f76b09a8f59ec1cc2dc09a23a47050a20797f3b735b6e094b26d86a2d117f60d89527121a64e869b403c09331c32
7
- data.tar.gz: 929c88e3d08db5fb926c6bf522667d1e8c5e9c36e59b1f63c783474a99cb423b08550c1ec8ff1fc8ac86113ac5bf7f5295da24371e93ea498bdeeeca48c17043
6
+ metadata.gz: c2e7f39293ff34a4ffb393cfbb06286635513020fed1340c737409bd719b4f8b2a1a2b54719c1c5994e27b2a97a2249c3b4a9dcc504477f69b22907be607fd10
7
+ data.tar.gz: 331c02315f949f2bddbe56dd0fba6c1d4217fadabd76b88ec72f19554f2b45d6fc1fcd95cdc1dd1aa54c5c1ee5fc1830dfca26311a5a6be0917c4784b57d2583
@@ -69,7 +69,6 @@ module Uploader
69
69
  # end
70
70
  #
71
71
  def uploader_create(params, request = nil)
72
-
73
72
  self.guid = params[:guid]
74
73
  self.assetable_type = params[:assetable_type]
75
74
  self.assetable_id = assetable_id_format(params[:assetable_id])
@@ -28,19 +28,19 @@ module Uploader
28
28
  def fileuploads(*args)
29
29
  options = args.extract_options!
30
30
 
31
- class_attribute :fileuploads_options, :instance_writer => false
31
+ class_attribute :fileuploads_options, instance_writer: false
32
32
  self.fileuploads_options = options
33
33
 
34
- class_attribute :fileuploads_columns, :instance_writer => false
34
+ class_attribute :fileuploads_columns, instance_writer: false
35
35
  self.fileuploads_columns = args.map(&:to_sym)
36
36
 
37
37
  unless self.is_a?(ClassMethods)
38
38
  include InstanceMethods
39
39
  extend ClassMethods
40
40
 
41
- after_save :fileuploads_update, :if => :fileupload_changed?
41
+ after_save :fileuploads_update, if: :fileupload_changed?
42
42
 
43
- fileuploads_columns.each { |asset| accepts_nested_attributes_for asset, :allow_destroy => true }
43
+ fileuploads_columns.each { |asset| accepts_nested_attributes_for(asset, allow_destroy: true) }
44
44
  end
45
45
  end
46
46
  end
@@ -48,17 +48,17 @@ module Uploader
48
48
  module ClassMethods
49
49
  # Update reflection klass by guid
50
50
  def fileupload_update(record_id, guid, method)
51
- fileupload_scope(method, guid).update_all(:assetable_id => record_id, :guid => nil)
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
- query = fileupload_scope(method, guid)
57
- fileupload_multiple?(method) ? query.all : query.first
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
- fileupload_klass(method).where(:guid => guid, :assetable_type => base_class.name.to_s)
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
@@ -3,7 +3,7 @@ module Uploader
3
3
  class FieldTag
4
4
  attr_reader :template, :object, :theme
5
5
 
6
- delegate :uploader, :to => :template
6
+ delegate :uploader, to: :template
7
7
 
8
8
  # Wrapper for render uploader field
9
9
  # Usage:
@@ -12,7 +12,7 @@ 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
16
 
17
17
  @template, @options = template, options.dup
18
18
 
@@ -24,8 +24,8 @@ module Uploader
24
24
  end
25
25
 
26
26
  def render(locals = {}) #:nodoc:
27
- locals = { :field => self }.merge(locals)
28
- @template.render :partial => "uploader/#{@theme}/container", :locals => locals
27
+ locals = { field: self }.merge(locals)
28
+ @template.render(partial: "uploader/#{@theme}/container", locals: locals)
29
29
  end
30
30
 
31
31
  def id
@@ -66,9 +66,9 @@ module Uploader
66
66
 
67
67
  def attachments_path(options = {})
68
68
  options = {
69
- :guid => @object.fileupload_guid,
70
- :assetable_type => @object.class.base_class.name.to_s,
71
- :klass => klass.to_s
69
+ guid: @object.fileupload_guid,
70
+ assetable_type: @object.class.base_class.name.to_s,
71
+ klass: klass.to_s
72
72
  }.merge(options)
73
73
 
74
74
  options[:assetable_id] = @object.id if @object.persisted?
@@ -78,9 +78,9 @@ module Uploader
78
78
 
79
79
  def input_html
80
80
  @input_html ||= {
81
- :"data-url" => attachments_path,
82
- :multiple => multiple?,
83
- :class => "uploader"
81
+ data: {url: attachments_path},
82
+ multiple: multiple?,
83
+ class: "uploader"
84
84
  }.merge(@options[:input_html] || {})
85
85
  end
86
86
  end
@@ -9,7 +9,7 @@ module Uploader
9
9
  # <%= end %>
10
10
  #
11
11
  def uploader_field(method, options = {})
12
- @template.send("uploader_field_tag", @object_name, method, objectify_options(options))
12
+ @template.send(:uploader_field_tag, @object_name, method, objectify_options(options))
13
13
  end
14
14
  end
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module Uploader
2
- VERSION = "0.2.6".freeze
2
+ VERSION = "0.2.7".freeze
3
3
  end
@@ -2732,3 +2732,165 @@ Started POST "/uploader/attachments" for 127.0.0.1 at 2015-06-15 11:27:27 +0300
2732
2732
   (0.1ms) begin transaction
2733
2733
   (0.1ms) rollback transaction
2734
2734
  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.4451ms)
2735
+ Connecting to database specified by database.yml
2736
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
2737
+ Migrating to CreateAssets (20120508093416)
2738
+ Migrating to CreateArticles (20120508093830)
2739
+  (0.1ms) begin transaction
2740
+  (0.2ms) SAVEPOINT active_record_1
2741
+ SQL (4.5ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", Wed, 16 Sep 2015 14:12:19 UTC +00:00], ["title", "MyString"], ["updated_at", Wed, 16 Sep 2015 14:12:19 UTC +00:00]]
2742
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2743
+  (0.2ms) SAVEPOINT active_record_1
2744
+ Picture Exists (0.5ms) SELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'WA1AbtuQ7jeQo1HP7mnZ' LIMIT 1
2745
+ SQL (2.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Wed, 16 Sep 2015 14:12:19 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "WA1AbtuQ7jeQo1HP7mnZ"], ["type", "Picture"], ["updated_at", Wed, 16 Sep 2015 14:12:19 UTC +00:00], ["user_id", nil]]
2746
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2747
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article' LIMIT 1
2748
+ SQL (0.3ms) UPDATE "assets" SET "assetable_id" = 1000, "guid" = NULL WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'
2749
+ Picture Load (0.1ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? LIMIT 1 [["id", 1]]
2750
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."guid" = 'TErF7L2krpzppOwEGMeQ' AND "assets"."assetable_type" = 'Article' LIMIT 1
2751
+  (0.1ms) SAVEPOINT active_record_1
2752
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2753
+  (1.1ms) rollback transaction
2754
+ MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (88.7461ms)
2755
+ 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 (20.8700ms)
2756
+  (0.1ms) begin transaction
2757
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"public_token"=>"FnCMBiWn0PB2EICBr1Xn"} flags=[:slave_ok] limit=1 skip=0 fields={:_id=>1} (2.1381ms)
2758
+ MOPED: 127.0.0.1:27017 INSERT database=rails_uploader_test collection=mongoid_pictures documents=[{"_id"=>"55f978c3dc26e7324d000001", "guid"=>"guid", "assetable_type"=>"MongoidArticle", "public_token"=>"FnCMBiWn0PB2EICBr1Xn"}] flags=[] (0.1543ms)
2759
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"$query"=>{"guid"=>"guid", "assetable_type"=>"MongoidArticle"}, "$orderby"=>{:_id=>1}} flags=[:slave_ok] limit=-1 skip=0 fields=nil (22.0480ms)
2760
+ MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:count=>"mongoid_pictures", :query=>{}} (0.7770ms)
2761
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.3068ms)
2762
+ MOPED: 127.0.0.1:27017 DELETE database=rails_uploader_test collection=mongoid_pictures selector={"_id"=>"55f978c3dc26e7324d000001"} flags=[:remove_first] (0.1030ms)
2763
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"public_token"=>"KMpsmnXsl7rSpHIBhL0E"} flags=[:slave_ok] limit=1 skip=0 fields={:_id=>1} (0.7970ms)
2764
+ MOPED: 127.0.0.1:27017 INSERT database=rails_uploader_test collection=mongoid_pictures documents=[{"_id"=>"55f978c4dc26e7324d000002", "guid"=>"guid", "assetable_type"=>"MongoidArticle", "public_token"=>"KMpsmnXsl7rSpHIBhL0E"}] flags=[] (0.1121ms)
2765
+ MOPED: 127.0.0.1:27017 UPDATE database=rails_uploader_test collection=mongoid_pictures selector={"guid"=>"guid", "assetable_type"=>"MongoidArticle"} update={"$set"=>{:assetable_id=>1000, :guid=>nil}} flags=[:multi] (0.1042ms)
2766
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={:_id=>"55f978c4dc26e7324d000002"} flags=[:slave_ok] limit=-1 skip=0 fields=nil (4.2341ms)
2767
+ MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:count=>"mongoid_pictures", :query=>{}} (0.3488ms)
2768
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.2899ms)
2769
+ MOPED: 127.0.0.1:27017 DELETE database=rails_uploader_test collection=mongoid_pictures selector={"_id"=>"55f978c4dc26e7324d000002"} flags=[:remove_first] (0.0730ms)
2770
+  (0.1ms) rollback transaction
2771
+ 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.4060ms)
2772
+ MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:drop=>"mongoid_pictures"} (1.0200ms)
2773
+  (0.0ms) begin transaction
2774
+
2775
+
2776
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2015-09-16 17:12:20 +0300
2777
+  (0.3ms) SAVEPOINT active_record_1
2778
+ Picture Exists (0.2ms) SELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'TStytNh7GioJBxd7OL7y' LIMIT 1
2779
+ SQL (0.5ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Wed, 16 Sep 2015 14:12:20 UTC +00:00], ["data_content_type", nil], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", "SOMESTRING"], ["public_token", "TStytNh7GioJBxd7OL7y"], ["type", "Picture"], ["updated_at", Wed, 16 Sep 2015 14:12:20 UTC +00:00], ["user_id", nil]]
2780
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2781
+  (0.1ms) SAVEPOINT active_record_1
2782
+ SQL (0.6ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", Wed, 16 Sep 2015 14:12:20 UTC +00:00], ["title", "MyString"], ["updated_at", Wed, 16 Sep 2015 14:12:20 UTC +00:00]]
2783
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2784
+  (0.0ms) SAVEPOINT active_record_1
2785
+ Picture Exists (0.1ms) SELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = '0TLrTvyEaTDE0kuc1xYZ' LIMIT 1
2786
+ SQL (0.3ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Wed, 16 Sep 2015 14:12:20 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "0TLrTvyEaTDE0kuc1xYZ"], ["type", "Picture"], ["updated_at", Wed, 16 Sep 2015 14:12:20 UTC +00:00], ["user_id", nil]]
2787
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2788
+  (0.1ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
2789
+
2790
+
2791
+ Started DELETE "/uploader/attachments/0TLrTvyEaTDE0kuc1xYZ" for 127.0.0.1 at 2015-09-16 17:12:20 +0300
2792
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = '0TLrTvyEaTDE0kuc1xYZ' LIMIT 1
2793
+  (0.0ms) SAVEPOINT active_record_1
2794
+ SQL (0.1ms) DELETE FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? [["id", 2]]
2795
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2796
+  (0.1ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
2797
+  (0.2ms) SAVEPOINT active_record_1
2798
+ SQL (0.4ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", Wed, 16 Sep 2015 14:12:20 UTC +00:00], ["title", "MyString"], ["updated_at", Wed, 16 Sep 2015 14:12:20 UTC +00:00]]
2799
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2800
+  (0.0ms) SAVEPOINT active_record_1
2801
+ Picture Exists (0.1ms) SELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'twEIdMnq8h2LtMqmIyor' LIMIT 1
2802
+ SQL (0.3ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", Wed, 16 Sep 2015 14:12:20 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "twEIdMnq8h2LtMqmIyor"], ["type", "Picture"], ["updated_at", Wed, 16 Sep 2015 14:12:20 UTC +00:00], ["user_id", nil]]
2803
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2804
+
2805
+
2806
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2015-09-16 17:12:20 +0300
2807
+ Picture Load (0.1ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'wrong' LIMIT 1
2808
+
2809
+
2810
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2015-09-16 17:12:20 +0300
2811
+  (0.7ms) rollback transaction
2812
+ 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.4277ms)
2813
+  (0.1ms) begin transaction
2814
+  (0.1ms) rollback transaction
2815
+ 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.3839ms)
2816
+ Connecting to database specified by database.yml
2817
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
2818
+ Migrating to CreateAssets (20120508093416)
2819
+ Migrating to CreateArticles (20120508093830)
2820
+  (0.1ms) begin transaction
2821
+  (0.0ms) SAVEPOINT active_record_1
2822
+ SQL (3.6ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["title", "MyString"], ["updated_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00]]
2823
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2824
+  (0.1ms) SAVEPOINT active_record_1
2825
+ Picture Exists (0.4ms) SELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'RB7rFB1gfx2mU8jmt9li' LIMIT 1
2826
+ SQL (2.3ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "RB7rFB1gfx2mU8jmt9li"], ["type", "Picture"], ["updated_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["user_id", nil]]
2827
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2828
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article' LIMIT 1
2829
+ SQL (0.2ms) UPDATE "assets" SET "assetable_id" = 1000, "guid" = NULL WHERE "assets"."type" IN ('Picture') AND "assets"."guid" IS NULL AND "assets"."assetable_type" = 'Article'
2830
+ Picture Load (0.1ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? LIMIT 1 [["id", 1]]
2831
+ Picture Load (0.1ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."guid" = 'tA6rmhFYHkxKDtxs5B5i' AND "assets"."assetable_type" = 'Article' LIMIT 1
2832
+  (0.1ms) SAVEPOINT active_record_1
2833
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2834
+  (0.7ms) rollback transaction
2835
+ MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} (8.0287ms)
2836
+ 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.9520ms)
2837
+  (0.1ms) begin transaction
2838
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"public_token"=>"zHh3o7TylhVJuFDXh8bn"} flags=[:slave_ok] limit=1 skip=0 fields={:_id=>1} (0.3500ms)
2839
+ MOPED: 127.0.0.1:27017 INSERT database=rails_uploader_test collection=mongoid_pictures documents=[{"_id"=>"55f978f9dc26e7574d000001", "guid"=>"guid", "assetable_type"=>"MongoidArticle", "public_token"=>"zHh3o7TylhVJuFDXh8bn"}] flags=[] (0.1650ms)
2840
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"$query"=>{"guid"=>"guid", "assetable_type"=>"MongoidArticle"}, "$orderby"=>{:_id=>1}} flags=[:slave_ok] limit=-1 skip=0 fields=nil (9.3479ms)
2841
+ MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:count=>"mongoid_pictures", :query=>{}} (0.4559ms)
2842
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.4208ms)
2843
+ MOPED: 127.0.0.1:27017 DELETE database=rails_uploader_test collection=mongoid_pictures selector={"_id"=>"55f978f9dc26e7574d000001"} flags=[:remove_first] (0.1740ms)
2844
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={"public_token"=>"7i2rXkK0QZo3XzZVPgsU"} flags=[:slave_ok] limit=1 skip=0 fields={:_id=>1} (0.5198ms)
2845
+ MOPED: 127.0.0.1:27017 INSERT database=rails_uploader_test collection=mongoid_pictures documents=[{"_id"=>"55f978f9dc26e7574d000002", "guid"=>"guid", "assetable_type"=>"MongoidArticle", "public_token"=>"7i2rXkK0QZo3XzZVPgsU"}] flags=[] (0.2198ms)
2846
+ MOPED: 127.0.0.1:27017 UPDATE database=rails_uploader_test collection=mongoid_pictures selector={"guid"=>"guid", "assetable_type"=>"MongoidArticle"} update={"$set"=>{:assetable_id=>1000, :guid=>nil}} flags=[:multi] (2.1350ms)
2847
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={:_id=>"55f978f9dc26e7574d000002"} flags=[:slave_ok] limit=-1 skip=0 fields=nil (6.9222ms)
2848
+ MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:count=>"mongoid_pictures", :query=>{}} (0.7071ms)
2849
+ MOPED: 127.0.0.1:27017 QUERY database=rails_uploader_test collection=mongoid_pictures selector={} flags=[:slave_ok] limit=0 skip=0 fields=nil (0.4852ms)
2850
+ MOPED: 127.0.0.1:27017 DELETE database=rails_uploader_test collection=mongoid_pictures selector={"_id"=>"55f978f9dc26e7574d000002"} flags=[:remove_first] (0.1302ms)
2851
+  (0.1ms) rollback transaction
2852
+ 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.7539ms)
2853
+ MOPED: 127.0.0.1:27017 COMMAND database=rails_uploader_test command={:drop=>"mongoid_pictures"} (0.7379ms)
2854
+  (0.1ms) begin transaction
2855
+
2856
+
2857
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2015-09-16 17:13:13 +0300
2858
+  (0.2ms) SAVEPOINT active_record_1
2859
+ Picture Exists (0.2ms) SELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'GfDlXbSV3Nah5tKGq57h' LIMIT 1
2860
+ SQL (0.6ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["data_content_type", nil], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", "SOMESTRING"], ["public_token", "GfDlXbSV3Nah5tKGq57h"], ["type", "Picture"], ["updated_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["user_id", nil]]
2861
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2862
+  (0.1ms) SAVEPOINT active_record_1
2863
+ SQL (0.5ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["title", "MyString"], ["updated_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00]]
2864
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2865
+  (0.1ms) SAVEPOINT active_record_1
2866
+ Picture Exists (0.1ms) SELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'TrnRntbWh3Cv2oIWeKlb' LIMIT 1
2867
+ SQL (0.3ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 1], ["assetable_type", "Article"], ["created_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "TrnRntbWh3Cv2oIWeKlb"], ["type", "Picture"], ["updated_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["user_id", nil]]
2868
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2869
+  (0.1ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
2870
+
2871
+
2872
+ Started DELETE "/uploader/attachments/TrnRntbWh3Cv2oIWeKlb" for 127.0.0.1 at 2015-09-16 17:13:13 +0300
2873
+ Picture Load (0.1ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'TrnRntbWh3Cv2oIWeKlb' LIMIT 1
2874
+  (0.1ms) SAVEPOINT active_record_1
2875
+ SQL (0.1ms) DELETE FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."id" = ? [["id", 2]]
2876
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2877
+  (0.1ms) SELECT COUNT(*) FROM "assets" WHERE "assets"."type" IN ('Picture')
2878
+  (0.1ms) SAVEPOINT active_record_1
2879
+ SQL (0.3ms) INSERT INTO "articles" ("content", "created_at", "title", "updated_at") VALUES (?, ?, ?, ?) [["content", "MyText"], ["created_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["title", "MyString"], ["updated_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00]]
2880
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2881
+  (0.0ms) SAVEPOINT active_record_1
2882
+ Picture Exists (0.1ms) SELECT 1 AS one FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'F7zCRaX4iwCVVLqHQ5kM' LIMIT 1
2883
+ SQL (0.4ms) INSERT INTO "assets" ("assetable_id", "assetable_type", "created_at", "data_content_type", "data_file_name", "data_file_size", "guid", "public_token", "type", "updated_at", "user_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["assetable_id", 2], ["assetable_type", "Article"], ["created_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["data_content_type", "image/png"], ["data_file_name", "rails.png"], ["data_file_size", nil], ["guid", nil], ["public_token", "F7zCRaX4iwCVVLqHQ5kM"], ["type", "Picture"], ["updated_at", Wed, 16 Sep 2015 14:13:13 UTC +00:00], ["user_id", nil]]
2884
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2885
+
2886
+
2887
+ Started DELETE "/uploader/attachments/wrong" for 127.0.0.1 at 2015-09-16 17:13:13 +0300
2888
+ Picture Load (0.2ms) SELECT "assets".* FROM "assets" WHERE "assets"."type" IN ('Picture') AND "assets"."public_token" = 'wrong' LIMIT 1
2889
+
2890
+
2891
+ Started POST "/uploader/attachments" for 127.0.0.1 at 2015-09-16 17:13:13 +0300
2892
+  (0.8ms) rollback transaction
2893
+ 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.4249ms)
2894
+  (0.1ms) begin transaction
2895
+  (0.1ms) rollback transaction
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)
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.6
4
+ version: 0.2.7
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: 2015-06-15 00:00:00.000000000 Z
12
+ date: 2015-09-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-ui-rails