File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -242,14 +242,11 @@ def validate(record)
242242
243243 class OptionsValidator < ActiveModel ::Validator
244244 def validate ( record )
245- if record . options . blank?
246- # Route Creation with explicit 'null' options is not allowed
247- record . errors . add ( :options , message : 'is not a valid object' ) if record . is_a? ( VCAP ::CloudController ::RouteCreateMessage ) && record . options . nil?
248- return
249- end
245+ # Empty option hashes are allowed, so we skip further validation
246+ record . options . blank? && return
250247
251248 unless record . options . is_a? ( Hash )
252- record . errors . add ( :options , message : ' is not a valid object' )
249+ record . errors . add ( :options , message : "'options' is not a valid object" )
253250 return
254251 end
255252
You can’t perform that action at this time.
0 commit comments