echo_uploads 0.0.10 → 0.0.11

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: b82e7d04075be6bf35940bee4a5d84cf7ad90434
4
- data.tar.gz: 6ecd6ee756247943e964cc92d0b07f3b7c161492
3
+ metadata.gz: 363da8049a3d95db7e590c2680081788edcc1405
4
+ data.tar.gz: da7c0bdef6ea0899b0087848437f4554d1361ee6
5
5
  SHA512:
6
- metadata.gz: 140ef7a33f89e767c1b94ca128413198c0850f784ea7990fafdbde796e09406d64c5c0c8d765c317f14ad50f0eae833a1dbf7da84103f1daa60d7e04117043fa
7
- data.tar.gz: eee115304fc5c1ee97d3b28cfea19ba7c498891b7a8ab49be3f06838181811ae4891e7be59a88686ebe41058b522b92d6e3d4d2be5eea601b9faac86f2e53489
6
+ metadata.gz: 2fd7a6828ce9252148d1b4c9bf4020963aea88ebb6656832c1d54e6bf3a46f1eeddd8b9a59b7762fc5b35d6c5ab829e744295f845eb42fd75e186cc5251ce7d3
7
+ data.tar.gz: a567d2d9ffb9e6e3da3ebe3225e4ce23faa56eebde9b0c67d8660592db8effd0f5d01afc1317f5b71f87ad6c2923b44aee4961bb8565fdc6ab86ff6fccab7061
@@ -72,6 +72,7 @@ module EchoUploads
72
72
  self.owner_attr = attr
73
73
  self.original_extension = ::File.extname(file.original_filename)
74
74
  self.original_basename = ::File.basename(file.original_filename, original_extension)
75
+ self.size = file.size
75
76
  compute_mime! options
76
77
  if options[:storage].is_a? String
77
78
  self.storage_type = options[:storage]
@@ -184,6 +184,10 @@ module EchoUploads
184
184
  echo_uploads_map_metadata(attr, options, &:read)
185
185
  end
186
186
 
187
+ define_method("#{attr}_size") do
188
+ echo_uploads_map_metadata(attr, options, &:size)
189
+ end
190
+
187
191
  # Define the association with the metadata model.
188
192
  if options[:multiple]
189
193
  has_many("#{attr}_metadatas".to_sym,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: echo_uploads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarrett Colby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-22 00:00:00.000000000 Z
11
+ date: 2014-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types