lib/patch_ruby/models/order.rb in patch_ruby-1.5.1 vs lib/patch_ruby/models/order.rb in patch_ruby-1.5.2
- old
+ new
@@ -183,12 +183,12 @@
if @mass_g > 2000000000
invalid_properties.push('invalid value for "mass_g", must be smaller than or equal to 2000000000.')
end
- if @mass_g < 1
- invalid_properties.push('invalid value for "mass_g", must be greater than or equal to 1.')
+ if @mass_g < 0
+ invalid_properties.push('invalid value for "mass_g", must be greater than or equal to 0.')
end
if @production.nil?
invalid_properties.push('invalid value for "production", production cannot be nil.')
end
@@ -216,11 +216,11 @@
# @return true if the model is valid
def valid?
return false if @id.nil?
return false if @mass_g.nil?
return false if @mass_g > 2000000000
- return false if @mass_g < 1
+ return false if @mass_g < 0
return false if @production.nil?
return false if @state.nil?
state_validator = EnumAttributeValidator.new('String', ["draft", "placed", "complete", "cancelled"])
return false unless state_validator.valid?(@state)
return false if @allocation_state.nil?
@@ -240,11 +240,11 @@
if mass_g > 2000000000
fail ArgumentError, 'invalid value for "mass_g", must be smaller than or equal to 2000000000.'
end
- if mass_g < 1
- fail ArgumentError, 'invalid value for "mass_g", must be greater than or equal to 1.'
+ if mass_g < 0
+ fail ArgumentError, 'invalid value for "mass_g", must be greater than or equal to 0.'
end
@mass_g = mass_g
end