cached_uploads 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cached_uploads.rb +6 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fde9467cec8d08ea9ae8f1111c8f4fe2fed0bfef
4
- data.tar.gz: 4a9b1e62c06d090618f95473dd5c5612618d5ab8
3
+ metadata.gz: f001577d8b2960c0ca257fba9204b6be90b3fcde
4
+ data.tar.gz: 66a23a6c52e90bf7c9ddf5e763d37057634e40df
5
5
  SHA512:
6
- metadata.gz: c7df3f750b350485861da5cfea8971627863a7781c374c4b2e7308a8feecffd139919fd27911c5bf90a49e34cf5ac21e328e70a5a15337f4b0102dd97ab07abb
7
- data.tar.gz: 2ec34cd5dc9c55080da960808afe587dbd67ccc0ec818113d26ebb5b9de59720b44d56d76df0b81cd59b07ee5b9651abeac7b6aa466caa2bd9006c9eeca5f076
6
+ metadata.gz: 0ebf1726a88388803a99ca7f2de38274f673dbde3bdbe63d913c46bd1a2a01c8b1b4f3765ce8be2452dc14c6b05d22beb7c871f215027c3bc3c09c2bf90f1813
7
+ data.tar.gz: 6ed8b66e76b106b191e3dfd45c46a02ba7c4345ce5e5ac1b483d8ee20b5e82ee7689c366f469ef69de1c4c3fcb86a2ae6743dfae0136a42a897c9a1a3df4c6ba
@@ -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 method_defined? options[:md5_attr]
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cached_uploads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarrett Colby