Thank you very much for replying but sadly I'm not yet good enough to
understand your fancy code.
Sorry i usually have a better crack at solving issues but I don't
understand what is going on in the section that begins (class <<
uploadedfile; self; end).class_eval. If you get time to reply that would
be excellent, if not thanks for giving me something to investigate
"class << uploadedfile; self; end" is a common technique to get
singleton class for that very instance to be able to extend it. I think
it could be done in a more simple way, I just took a code from
file_column's test method that simulate an uploaded file.
In Rails, uploaded file is an IO object or the like (which has "read"
method) extended with some instance methods (local_path,
Regarding your error, I think you haven't required 'open-uri' library
and this line
uploadedfile = StringIO.new(remote.read)
haven't got executed. That's probably why you've got "undefined
variable" error. I suggest you to put all the code inside open(uri)
block so you'll ensure that nothing will happen if it is unable to open