Skip to content

Instantly share code, notes, and snippets.

@sprite2005
Created July 12, 2010 22:30
Show Gist options
  • Save sprite2005/473168 to your computer and use it in GitHub Desktop.
Save sprite2005/473168 to your computer and use it in GitHub Desktop.
WORKS IN MRI
deploy@domU-12-31-39-06-60-53 /data/vipwithme/current $ ruby script/console production
Loading production environment (Rails 2.3.5)
>> require 'action_controller/test_process.rb'
=> true
>> attachment = Attachment.new(:uploaded_data => ActionController::TestUploadedFile.new('/var/lib/asterisk/sounds/vipwithme/recordings/9.wav', 'audio/x-wav'))
=> #<Attachment id: nil, size: nil, height: nil, width: nil, parent_id: nil, attachable_id: nil, position: nil, content_type: "audio/x-wav", filename: "9.wav", thumbnail: nil, attachable_type: nil, created_at: nil, updated_at: nil, duration: nil>
>>
DOES NOT WORK IN JRUBY
Loading jruby environment (Rails 2.3.5)
>> require 'action_controller/test_process.rb'
=> []
>> attachment = Attachment.new(:uploaded_data => ActionController::TestUploadedFile.new('/var/lib/asterisk/sounds/vipwithme/recordings/9.wav', 'audio/x-wav'))
=> #<Attachment id: nil, size: nil, height: nil, width: nil, parent_id: nil, attachable_id: nil, position: nil, content_type: nil, filename: nil, thumbnail: nil, attachable_type: nil, created_at: nil, updated_at: nil, duration: nil>
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment