[PATCH conductor] Condition added to XML validation in Deployable

ifarkas at redhat.com ifarkas at redhat.com
Thu Dec 8 09:32:31 UTC 2011


From: Imre Farkas <ifarkas at redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=756690
---
 src/app/models/deployable.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/app/models/deployable.rb b/src/app/models/deployable.rb
index 498c0cd..a148543 100644
--- a/src/app/models/deployable.rb
+++ b/src/app/models/deployable.rb
@@ -27,7 +27,7 @@ class Deployable < ActiveRecord::Base
   validates_length_of :name, :maximum => 1024
 
   validates_presence_of :xml
-  validate :valid_deployable_xml?
+  validate :valid_deployable_xml?, :if => Proc.new { |deployable| !deployable.xml.blank? }
 
   has_many :permissions, :as => :permission_object, :dependent => :destroy,
            :include => [:role],
-- 
1.7.6.4




More information about the aeolus-devel mailing list