Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solved Rails 3.0.3 temp_file size problem. Maybe this needs a more solid fix #31

Open
procommerz opened this issue Jan 13, 2011 · 1 comment

Comments

@procommerz
Copy link

Here's the new Technoweenie::AttachmentFu::InstanceMethods.temp_path method code that nails down this problem:

def temp_path
    p = temp_paths.first

    if p.is_a?(ActionDispatch::Http::UploadedFile) # Rails 3.0.3 compatability fix
      p.tempfile.path
    else
      p.respond_to?(:path) ? p.path : p.to_s
    end
end

It appears, that attachment_fu expected temp_paths.first to be a File, but with Rails 3.0.3 it turns out to be an ctionDispatch::Http::UploadedFile, which is wrapped around a file and won't provide 'path' accessor directly.

@technoweenie
Copy link
Owner

I don't use the plugin anymore. If you submit a pull request with a working fix, I'll gladly apply it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants