Permalink
Browse files

Remove the ‘renderErrorMessage’ method

  • Loading branch information...
1 parent f883458 commit 16d4bfafc2397f3aa40cbc04509727db6e14f1bf @Baggz committed Mar 12, 2012
Showing with 0 additions and 31 deletions.
  1. +0 −31 src/engines/json/renderErrorMessage.js
@@ -1,31 +0,0 @@
-/**
- * RenderErrorMessage
- *
- * @param {string} attributeName
- * @param {object} templateData
- */
-Validation.prototype.renderErrorMessage = function(attributeName, templateData) {
-
- // Gets an error message
- var errorMessage = this.messages[attributeName];
-
- // If the error message is a function
- if (typeof errorMessage === 'function') {
- return errorMessage(
- templateData.property,
- templateData.propertyValue,
- templateData.attribute
- );
- }
-
- // If the error message is a string
- if (typeof errorMessage === 'string') {
- each(templateData, function(key, value) {
- errorMessage = errorMessage.replace(new RegExp('{{' + key + '}}', 'g'), value);
- });
- return errorMessage.replace(/\s+/g, ' ');
- }
-
- return '';
-
-};

0 comments on commit 16d4bfa

Please sign in to comment.