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

Files from file_field coming through as Array, not File objects #429

Closed
radar opened this issue May 7, 2011 · 3 comments
Closed

Files from file_field coming through as Array, not File objects #429

radar opened this issue May 7, 2011 · 3 comments
Assignees
Milestone

Comments

@radar
Copy link
Contributor

radar commented May 7, 2011

Hello again,

I have a project at https://github.com/rails3book/edge-ticketee/tree/chapter_8 which has the features/creating_tickets.feature feature failing because files are not being passed correctly. You can duplicate this by running:

bundle install
bundle exec cucumber features/creating_tickets.feature:38

It will give this error:

Then I should see "speed.txt" within "#ticket .asset"
    Unable to find '#ticket .asset' (Capybara::ElementNotFound)
    ./features/step_definitions/web_steps.rb:29:in `with_scope'
    ./features/step_definitions/web_steps.rb:36:in `/^(. within ([^:]+)$/'
    features/creating_tickets.feature:45:in `Then I should see "speed.txt" within "#ticket .asset"'

If you inspect the parameters in the controller for ticket, namely the asset parameter, you'll see this:

"asset"=>["The blink tag can blink faster if you use the speed=\"hyper\" attribute."]

In previous versions of Rails, this always came through as a Tempfile object, and I think Paperclip is still expecting it to be that because it's not saving that file anywhere.

@ghost ghost assigned josevalim May 7, 2011
@josevalim
Copy link
Contributor

Hey @radar, we are close to Rails 3.1 release and there are a lot of issues. If you can help us pinpoint exactly were is the error, it would be great! I know it should be working automatically, but can you confirm if the form is being set to multipart?

@radar
Copy link
Contributor Author

radar commented May 7, 2011

The form is automatically being set to multipart. If I set :html => { :multipart => true } in the form it does the same thing, but :html => { :multipart => false } (as expected) sends through the file names, not the content.

I will attempt to track down this issue today.

@radar
Copy link
Contributor Author

radar commented May 7, 2011

fffffffffuuuuuuuuuuuuuu

This seems to be another Rack::Test bug, as it works fine when running the application in development mode.

@radar radar closed this as completed May 7, 2011
matthewd pushed a commit that referenced this issue Apr 24, 2018
Update to_sql.rb. More slightly performance improvement.
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