Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Making is invalid compatible with Rails

  • Loading branch information...
commit a5e981fe534f2f37bfa955bf9656ac31a4c783d3 1 parent 9fa0693
@bermi bermi authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 active_support/models/errors.php
View
6 active_support/models/errors.php
@@ -111,8 +111,12 @@ public function addErrorOnBoundryBreaking ($attributes, $range_begin, $range_end
/**
* @return bool Returns true if the specified $attribute has errors associated with it.
+ * If no attribute is given returns true if errors were added to the model.
*/
- public function isInvalid($attribute) {
+ public function isInvalid($attribute = null) {
+ if($attribute == null){
+ return !$this->_Model->isValid();
+ }
return $this->getErrorsOn($attribute);
}
Please sign in to comment.
Something went wrong with that request. Please try again.