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 +4 -4
- data/lib/echo_uploads/file.rb +1 -0
- data/lib/echo_uploads/model.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 363da8049a3d95db7e590c2680081788edcc1405
|
4
|
+
data.tar.gz: da7c0bdef6ea0899b0087848437f4554d1361ee6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fd7a6828ce9252148d1b4c9bf4020963aea88ebb6656832c1d54e6bf3a46f1eeddd8b9a59b7762fc5b35d6c5ab829e744295f845eb42fd75e186cc5251ce7d3
|
7
|
+
data.tar.gz: a567d2d9ffb9e6e3da3ebe3225e4ce23faa56eebde9b0c67d8660592db8effd0f5d01afc1317f5b71f87ad6c2923b44aee4961bb8565fdc6ab86ff6fccab7061
|
data/lib/echo_uploads/file.rb
CHANGED
@@ -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]
|
data/lib/echo_uploads/model.rb
CHANGED
@@ -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.
|
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
|
11
|
+
date: 2014-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|