On Nov 13, 2007 9:11 AM, João Paulo Lins <[EMAIL PROTECTED]> wrote:
> I would like to suggest Rails returns only FileTemp, because the
> optimization with StringIO may cause to the programmer enter bugs in
> your implementation by not knowing what type of return receive.
> I know that he can take a test to fix this type of problem:
>
>   If upload_file.instance_of? (Tempfile) # Treat as TempFile else
> StringIO
>
> If this test should be the solution rather than modify the rails I
> believe this kind of behavior should be documented, otherwise you can
> take things like I will guess always receive FileTemp, which is not
> true.

What bugs have you hit due to this optimisation?    Assuming that
removing it doesn't impact too poorly on performance, and we can't
make them ducktype nicely, then it seems reasonable to remove.

>
> I looked at Rails code and it is easy to do this improvement. What do
> you think about it?
>
> >
>



-- 
Cheers

Koz

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to