{"action":"created","comment":{"url":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/comments/41223891","id":41223891,"diff_hunk":"@@ -289,5 +294,11 @@ export default Ember.Mixin.create({\n               .replace(/([A-Z])/g, ' $1')\n               // uppercase the first character\n               .replace(/^./, function(str){ return Ember.String.capitalize(str); });\n+  },\n+  _isFunction: function(func) {\n+    return typeof func === 'function';","path":"addon/mixins/model-validator.js","position":null,"original_position":20,"commit_id":"5f5fdaceef51dfb53cde22d50e67a739dfcc644b","original_commit_id":"b2c181b983cd25caadae3803c2b4eed2e9832ae9","user":{"login":"dmuneras","id":344518,"avatar_url":"https://avatars.githubusercontent.com/u/344518?v=3","gravatar_id":"","url":"https://api.github.com/users/dmuneras","html_url":"https://github.com/dmuneras","followers_url":"https://api.github.com/users/dmuneras/followers","following_url":"https://api.github.com/users/dmuneras/following{/other_user}","gists_url":"https://api.github.com/users/dmuneras/gists{/gist_id}","starred_url":"https://api.github.com/users/dmuneras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmuneras/subscriptions","organizations_url":"https://api.github.com/users/dmuneras/orgs","repos_url":"https://api.github.com/users/dmuneras/repos","events_url":"https://api.github.com/users/dmuneras/events{/privacy}","received_events_url":"https://api.github.com/users/dmuneras/received_events","type":"User","site_admin":false},"body":"@esbanarango  got it.","created_at":"2015-10-06T03:54:36Z","updated_at":"2015-10-06T03:54:36Z","html_url":"https://github.com/esbanarango/ember-model-validator/pull/14#discussion_r41223891","pull_request_url":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/comments/41223891"},"html":{"href":"https://github.com/esbanarango/ember-model-validator/pull/14#discussion_r41223891"},"pull_request":{"href":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/14","id":46815227,"html_url":"https://github.com/esbanarango/ember-model-validator/pull/14","diff_url":"https://github.com/esbanarango/ember-model-validator/pull/14.diff","patch_url":"https://github.com/esbanarango/ember-model-validator/pull/14.patch","issue_url":"https://api.github.com/repos/esbanarango/ember-model-validator/issues/14","number":14,"state":"open","locked":false,"title":"Allowing to generate custom message with a function that retuns a string","user":{"login":"dmuneras","id":344518,"avatar_url":"https://avatars.githubusercontent.com/u/344518?v=3","gravatar_id":"","url":"https://api.github.com/users/dmuneras","html_url":"https://github.com/dmuneras","followers_url":"https://api.github.com/users/dmuneras/followers","following_url":"https://api.github.com/users/dmuneras/following{/other_user}","gists_url":"https://api.github.com/users/dmuneras/gists{/gist_id}","starred_url":"https://api.github.com/users/dmuneras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmuneras/subscriptions","organizations_url":"https://api.github.com/users/dmuneras/orgs","repos_url":"https://api.github.com/users/dmuneras/repos","events_url":"https://api.github.com/users/dmuneras/events{/privacy}","received_events_url":"https://api.github.com/users/dmuneras/received_events","type":"User","site_admin":false},"body":"@esbanarango I added the option to generate the custom error message using a function, because sometimes you have to generate a message using some model attributes, or something similar.\r\n\r\nExample:\r\n=======\r\n\r\nA validation checks if a number is between 10 and 20. In the case you want to tell the user:\r\n\r\n*  'the number is too small', if the number is lower than 10\r\n*  'the number is too big',  if the number is bigger than 20. \r\n\r\nYou have to have a function to check this.\r\n\r\nAnother case is when you want to include a \"constant\" of some variable in the message, for example, when you have a \"constant\" with the range, something like \"the number is not within [10...20]\"\r\n","created_at":"2015-10-05T18:24:26Z","updated_at":"2015-10-06T03:54:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d9edc6280c4e45c67e6af55391f644b91d8fb4b","assignee":{"login":"esbanarango","id":1156865,"avatar_url":"https://avatars.githubusercontent.com/u/1156865?v=3","gravatar_id":"","url":"https://api.github.com/users/esbanarango","html_url":"https://github.com/esbanarango","followers_url":"https://api.github.com/users/esbanarango/followers","following_url":"https://api.github.com/users/esbanarango/following{/other_user}","gists_url":"https://api.github.com/users/esbanarango/gists{/gist_id}","starred_url":"https://api.github.com/users/esbanarango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esbanarango/subscriptions","organizations_url":"https://api.github.com/users/esbanarango/orgs","repos_url":"https://api.github.com/users/esbanarango/repos","events_url":"https://api.github.com/users/esbanarango/events{/privacy}","received_events_url":"https://api.github.com/users/esbanarango/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/14/commits","review_comments_url":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/14/comments","review_comment_url":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/esbanarango/ember-model-validator/issues/14/comments","statuses_url":"https://api.github.com/repos/esbanarango/ember-model-validator/statuses/5f5fdaceef51dfb53cde22d50e67a739dfcc644b","head":{"label":"dmuneras:master","ref":"master","sha":"5f5fdaceef51dfb53cde22d50e67a739dfcc644b","user":{"login":"dmuneras","id":344518,"avatar_url":"https://avatars.githubusercontent.com/u/344518?v=3","gravatar_id":"","url":"https://api.github.com/users/dmuneras","html_url":"https://github.com/dmuneras","followers_url":"https://api.github.com/users/dmuneras/followers","following_url":"https://api.github.com/users/dmuneras/following{/other_user}","gists_url":"https://api.github.com/users/dmuneras/gists{/gist_id}","starred_url":"https://api.github.com/users/dmuneras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmuneras/subscriptions","organizations_url":"https://api.github.com/users/dmuneras/orgs","repos_url":"https://api.github.com/users/dmuneras/repos","events_url":"https://api.github.com/users/dmuneras/events{/privacy}","received_events_url":"https://api.github.com/users/dmuneras/received_events","type":"User","site_admin":false},"repo":{"id":36455349,"name":"ember-model-validator","full_name":"dmuneras/ember-model-validator","owner":{"login":"dmuneras","id":344518,"avatar_url":"https://avatars.githubusercontent.com/u/344518?v=3","gravatar_id":"","url":"https://api.github.com/users/dmuneras","html_url":"https://github.com/dmuneras","followers_url":"https://api.github.com/users/dmuneras/followers","following_url":"https://api.github.com/users/dmuneras/following{/other_user}","gists_url":"https://api.github.com/users/dmuneras/gists{/gist_id}","starred_url":"https://api.github.com/users/dmuneras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmuneras/subscriptions","organizations_url":"https://api.github.com/users/dmuneras/orgs","repos_url":"https://api.github.com/users/dmuneras/repos","events_url":"https://api.github.com/users/dmuneras/events{/privacy}","received_events_url":"https://api.github.com/users/dmuneras/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmuneras/ember-model-validator","description":"ember-cli package, which adds validation support to your Ember-Data models.","fork":true,"url":"https://api.github.com/repos/dmuneras/ember-model-validator","forks_url":"https://api.github.com/repos/dmuneras/ember-model-validator/forks","keys_url":"https://api.github.com/repos/dmuneras/ember-model-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmuneras/ember-model-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmuneras/ember-model-validator/teams","hooks_url":"https://api.github.com/repos/dmuneras/ember-model-validator/hooks","issue_events_url":"https://api.github.com/repos/dmuneras/ember-model-validator/issues/events{/number}","events_url":"https://api.github.com/repos/dmuneras/ember-model-validator/events","assignees_url":"https://api.github.com/repos/dmuneras/ember-model-validator/assignees{/user}","branches_url":"https://api.github.com/repos/dmuneras/ember-model-validator/branches{/branch}","tags_url":"https://api.github.com/repos/dmuneras/ember-model-validator/tags","blobs_url":"https://api.github.com/repos/dmuneras/ember-model-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmuneras/ember-model-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmuneras/ember-model-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmuneras/ember-model-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmuneras/ember-model-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/dmuneras/ember-model-validator/languages","stargazers_url":"https://api.github.com/repos/dmuneras/ember-model-validator/stargazers","contributors_url":"https://api.github.com/repos/dmuneras/ember-model-validator/contributors","subscribers_url":"https://api.github.com/repos/dmuneras/ember-model-validator/subscribers","subscription_url":"https://api.github.com/repos/dmuneras/ember-model-validator/subscription","commits_url":"https://api.github.com/repos/dmuneras/ember-model-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmuneras/ember-model-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmuneras/ember-model-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmuneras/ember-model-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmuneras/ember-model-validator/contents/{+path}","compare_url":"https://api.github.com/repos/dmuneras/ember-model-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmuneras/ember-model-validator/merges","archive_url":"https://api.github.com/repos/dmuneras/ember-model-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmuneras/ember-model-validator/downloads","issues_url":"https://api.github.com/repos/dmuneras/ember-model-validator/issues{/number}","pulls_url":"https://api.github.com/repos/dmuneras/ember-model-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/dmuneras/ember-model-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/dmuneras/ember-model-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmuneras/ember-model-validator/labels{/name}","releases_url":"https://api.github.com/repos/dmuneras/ember-model-validator/releases{/id}","created_at":"2015-05-28T17:40:39Z","updated_at":"2015-05-28T17:40:40Z","pushed_at":"2015-10-06T03:53:32Z","git_url":"git://github.com/dmuneras/ember-model-validator.git","ssh_url":"git@github.com:dmuneras/ember-model-validator.git","clone_url":"https://github.com/dmuneras/ember-model-validator.git","svn_url":"https://github.com/dmuneras/ember-model-validator","homepage":"","size":184,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"esbanarango:master","ref":"master","sha":"045cea1573508d15bac1df77515eab6017e0e60e","user":{"login":"esbanarango","id":1156865,"avatar_url":"https://avatars.githubusercontent.com/u/1156865?v=3","gravatar_id":"","url":"https://api.github.com/users/esbanarango","html_url":"https://github.com/esbanarango","followers_url":"https://api.github.com/users/esbanarango/followers","following_url":"https://api.github.com/users/esbanarango/following{/other_user}","gists_url":"https://api.github.com/users/esbanarango/gists{/gist_id}","starred_url":"https://api.github.com/users/esbanarango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esbanarango/subscriptions","organizations_url":"https://api.github.com/users/esbanarango/orgs","repos_url":"https://api.github.com/users/esbanarango/repos","events_url":"https://api.github.com/users/esbanarango/events{/privacy}","received_events_url":"https://api.github.com/users/esbanarango/received_events","type":"User","site_admin":false},"repo":{"id":35519092,"name":"ember-model-validator","full_name":"esbanarango/ember-model-validator","owner":{"login":"esbanarango","id":1156865,"avatar_url":"https://avatars.githubusercontent.com/u/1156865?v=3","gravatar_id":"","url":"https://api.github.com/users/esbanarango","html_url":"https://github.com/esbanarango","followers_url":"https://api.github.com/users/esbanarango/followers","following_url":"https://api.github.com/users/esbanarango/following{/other_user}","gists_url":"https://api.github.com/users/esbanarango/gists{/gist_id}","starred_url":"https://api.github.com/users/esbanarango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esbanarango/subscriptions","organizations_url":"https://api.github.com/users/esbanarango/orgs","repos_url":"https://api.github.com/users/esbanarango/repos","events_url":"https://api.github.com/users/esbanarango/events{/privacy}","received_events_url":"https://api.github.com/users/esbanarango/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/esbanarango/ember-model-validator","description":"ember-cli package, which adds validation support to your Ember-Data models.","fork":false,"url":"https://api.github.com/repos/esbanarango/ember-model-validator","forks_url":"https://api.github.com/repos/esbanarango/ember-model-validator/forks","keys_url":"https://api.github.com/repos/esbanarango/ember-model-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/esbanarango/ember-model-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/esbanarango/ember-model-validator/teams","hooks_url":"https://api.github.com/repos/esbanarango/ember-model-validator/hooks","issue_events_url":"https://api.github.com/repos/esbanarango/ember-model-validator/issues/events{/number}","events_url":"https://api.github.com/repos/esbanarango/ember-model-validator/events","assignees_url":"https://api.github.com/repos/esbanarango/ember-model-validator/assignees{/user}","branches_url":"https://api.github.com/repos/esbanarango/ember-model-validator/branches{/branch}","tags_url":"https://api.github.com/repos/esbanarango/ember-model-validator/tags","blobs_url":"https://api.github.com/repos/esbanarango/ember-model-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/esbanarango/ember-model-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/esbanarango/ember-model-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/esbanarango/ember-model-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/esbanarango/ember-model-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/esbanarango/ember-model-validator/languages","stargazers_url":"https://api.github.com/repos/esbanarango/ember-model-validator/stargazers","contributors_url":"https://api.github.com/repos/esbanarango/ember-model-validator/contributors","subscribers_url":"https://api.github.com/repos/esbanarango/ember-model-validator/subscribers","subscription_url":"https://api.github.com/repos/esbanarango/ember-model-validator/subscription","commits_url":"https://api.github.com/repos/esbanarango/ember-model-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/esbanarango/ember-model-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/esbanarango/ember-model-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/esbanarango/ember-model-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/esbanarango/ember-model-validator/contents/{+path}","compare_url":"https://api.github.com/repos/esbanarango/ember-model-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/esbanarango/ember-model-validator/merges","archive_url":"https://api.github.com/repos/esbanarango/ember-model-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/esbanarango/ember-model-validator/downloads","issues_url":"https://api.github.com/repos/esbanarango/ember-model-validator/issues{/number}","pulls_url":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/esbanarango/ember-model-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/esbanarango/ember-model-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/esbanarango/ember-model-validator/labels{/name}","releases_url":"https://api.github.com/repos/esbanarango/ember-model-validator/releases{/id}","created_at":"2015-05-13T00:14:59Z","updated_at":"2015-09-24T11:37:09Z","pushed_at":"2015-10-06T03:53:32Z","git_url":"git://github.com/esbanarango/ember-model-validator.git","ssh_url":"git@github.com:esbanarango/ember-model-validator.git","clone_url":"https://github.com/esbanarango/ember-model-validator.git","svn_url":"https://github.com/esbanarango/ember-model-validator","homepage":"","size":326,"stargazers_count":23,"watchers_count":23,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/14"},"html":{"href":"https://github.com/esbanarango/ember-model-validator/pull/14"},"issue":{"href":"https://api.github.com/repos/esbanarango/ember-model-validator/issues/14"},"comments":{"href":"https://api.github.com/repos/esbanarango/ember-model-validator/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/esbanarango/ember-model-validator/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/esbanarango/ember-model-validator/statuses/5f5fdaceef51dfb53cde22d50e67a739dfcc644b"}}}}