lib/rasti/form/validable.rb in rasti-form-3.1.2 vs lib/rasti/form/validable.rb in rasti-form-4.0.0
- old
+ new
@@ -15,20 +15,19 @@
def validate
end
def assert(key, condition, message)
- return true if condition
-
- errors[key] << message
- false
+ errors[key] << message unless condition
+ condition
end
def assert_not_error(key)
yield
true
- rescue => error
- assert key, false, error.message
+ rescue => ex
+ errors[key] << ex.message
+ false
end
end
end
end