cached_uploads 0.0.2 → 0.0.3
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/cached_uploads.rb +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f001577d8b2960c0ca257fba9204b6be90b3fcde
|
4
|
+
data.tar.gz: 66a23a6c52e90bf7c9ddf5e763d37057634e40df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ebf1726a88388803a99ca7f2de38274f673dbde3bdbe63d913c46bd1a2a01c8b1b4f3765ce8be2452dc14c6b05d22beb7c871f215027c3bc3c09c2bf90f1813
|
7
|
+
data.tar.gz: 6ed8b66e76b106b191e3dfd45c46a02ba7c4345ce5e5ac1b483d8ee20b5e82ee7689c366f469ef69de1c4c3fcb86a2ae6743dfae0136a42a897c9a1a3df4c6ba
|
data/lib/cached_uploads.rb
CHANGED
@@ -170,7 +170,8 @@ module CachedUploads
|
|
170
170
|
# cleaned out. Defaults to +48.hours+.
|
171
171
|
#
|
172
172
|
# - +ext_attr+: Name of the instance attribute storing the file's extension. Defaults
|
173
|
-
# to +"#{file_attr}_ext"+.
|
173
|
+
# to +"#{file_attr}_ext"+. CachedUploads does not define this method for you.
|
174
|
+
# Typically, this attribute would be a database column.
|
174
175
|
#
|
175
176
|
# - +md5_attr+: Name of the instance attribute storing the file's MD5 hash. Defaults
|
176
177
|
# to +"#{file_attr}_md5"+. It is often wise to make this attribute a database
|
@@ -211,7 +212,10 @@ module CachedUploads
|
|
211
212
|
|
212
213
|
# Define the accessor for the temporary file MD5 string. (Unless it's already
|
213
214
|
# defined, e.g. as a database column.)
|
214
|
-
unless
|
215
|
+
unless (
|
216
|
+
method_defined? options[:md5_attr] or
|
217
|
+
(respond_to? :columns and columns.map { |c| c.name.to_sym }.include?(options[:md5_attr].to_sym))
|
218
|
+
)
|
215
219
|
attr_accessor options[:md5_attr]
|
216
220
|
end
|
217
221
|
|