[PATCH conductor] Fix deployable uploading in Ruby 1.9

ifarkas at redhat.com ifarkas at redhat.com
Wed Jun 13 13:58:44 UTC 2012


From: Imre Farkas <ifarkas at redhat.com>

The Object#instance_variables method in Ruby 1.9 is returning an array of symbols instead of and array of strings as in Ruby 1.8
---
 src/app/models/deployable.rb |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/app/models/deployable.rb b/src/app/models/deployable.rb
index 68e8c4b..9c6aff9 100644
--- a/src/app/models/deployable.rb
+++ b/src/app/models/deployable.rb
@@ -112,7 +112,7 @@ class Deployable < ActiveRecord::Base
   #method used with uploading deployable xml in catalog_entries#new
   def xml=(data)
     #for new
-    if data.instance_variables.include?("@original_filename") && data.instance_variables.include?("@tempfile")
+    if data.is_a?(ActionDispatch::Http::UploadedFile)
       write_attribute :xml_filename, data.original_filename
       write_attribute :xml, data.tempfile.read
     #for update or new from_url
-- 
1.7.10.2




More information about the aeolus-devel mailing list