Skip to content

Instantly share code, notes, and snippets.

@debprado
Created July 30, 2011 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debprado/1115635 to your computer and use it in GitHub Desktop.
Save debprado/1115635 to your computer and use it in GitHub Desktop.
Fix attachment_fu in rails 3
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
@debprado
Copy link
Author

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