Larry Kluger
2007-Jul-01 15:11 UTC
rake: uninitialized const ActionController::TestUploadedFile
Hi, My app uses attachment_fu and I''d like to pre-load some data via a rake task. Thus: [code]desc "Upload template files" task :upload_files_test => :environment do |t| conf = Conference.find(1) [{:f => ''styles.css'', :type_code => ''css'', :content_type => ''text/css''}].each do |i| file ActionController::TestUploadedFile.new("db/migrate/widgets_layout/" + i[:f], i[:content_type]) conf.conference_files.create(:uploaded_data => file) end end[/code] But I get the rake error uninitialized constant ActionController::TestUploadedFile If I start the console, ActionController::TestUploadedFile.new works fine. *Thank you* for any ideas, Larry -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---