Skip to content

Commit 2f347ba

Browse files
authored
Merge pull request #77 from OpenBuildings/error-message-improvement
Add name parameter to error messages
2 parents 58807e6 + 313aa76 commit 2f347ba

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

classes/Kohana/Jam/Errors.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public function messages($attribute = NULL)
102102
{
103103
$messages[] = Jam_Errors::message($this->_error_filename, $attribute_name, $error, Arr::merge($params, array(
104104
':model' => $this->_meta->model(),
105+
':name' => $this->_model->name(),
105106
':attribute' => Jam_Errors::attribute_label($this->_meta, $attribute_name),
106107
)));
107108
}
@@ -150,6 +151,7 @@ private function _add_messages_all(Jam_Validated $model, array & $messages)
150151

151152
$messages[] = $model_name.': '.Jam_Errors::message($model->meta()->errors_filename(), $attribute_name, $error, Arr::merge($params, array(
152153
':model' => $model->meta()->model(),
154+
':name' => $model->name(),
153155
':attribute' => Jam_Errors::attribute_label($model->meta(), $attribute_name),
154156
)));
155157
}

0 commit comments

Comments
 (0)