Use file size of the io adapters #12

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@stmichael

It makes sense to use the io adapters size method to determine the file size instead of using File.size(file). I got an error when I tried to assign a file object to the attachment property of my model.

TypeError:
       can't convert Paperclip::FileAdapter into String
     # /Users/ms/.rvm/gems/ruby-1.9.3-p0@equis-domain/gems/paperclip-meta-0.4.1/lib/paperclip-meta/attachment.rb:36:in `size'
     # /Users/ms/.rvm/gems/ruby-1.9.3-p0@equis-domain/gems/paperclip-meta-0.4.1/lib/paperclip-meta/attachment.rb:36:in `block in post_process_styles_with_meta_data'
     # /Users/ms/.rvm/gems/ruby-1.9.3-p0@equis-domain/gems/paperclip-meta-0.4.1/lib/paperclip-meta/attachment.rb:33:in `each'
     # /Users/ms/.rvm/gems/ruby-1.9.3-p0@equis-domain/gems/paperclip-meta-0.4.1/lib/paperclip-meta/attachment.rb:33:in `post_process_styles_with_meta_data'
     # /Users/ms/.rvm/gems/ruby-1.9.3-p0@equis-domain/gems/paperclip-3.0.1/lib/paperclip/attachment.rb:376:in `block (2 levels) in post_process'

I think this only occurs since paperclip version 3.0.0 since there were no io adapters before that.

@teeparham

This comment has been minimized.

Show comment Hide comment
@teeparham

teeparham Jan 30, 2014

Owner

This should be resolved. Closing as stale.

Owner

teeparham commented Jan 30, 2014

This should be resolved. Closing as stale.

@teeparham teeparham closed this Jan 30, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment