{"action":"created","issue":{"url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/175","repository_url":"https://api.github.com/repos/offirgolan/ember-cp-validations","labels_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/175/comments","events_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/175/events","html_url":"https://github.com/offirgolan/ember-cp-validations/issues/175","id":150829252,"number":175,"title":"Expose a DS.Errors compatible API","user":{"login":"musaffa","id":294616,"avatar_url":"https://avatars.githubusercontent.com/u/294616?v=3","gravatar_id":"","url":"https://api.github.com/users/musaffa","html_url":"https://github.com/musaffa","followers_url":"https://api.github.com/users/musaffa/followers","following_url":"https://api.github.com/users/musaffa/following{/other_user}","gists_url":"https://api.github.com/users/musaffa/gists{/gist_id}","starred_url":"https://api.github.com/users/musaffa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musaffa/subscriptions","organizations_url":"https://api.github.com/users/musaffa/orgs","repos_url":"https://api.github.com/users/musaffa/repos","events_url":"https://api.github.com/users/musaffa/events{/privacy}","received_events_url":"https://api.github.com/users/musaffa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-04-25T11:31:16Z","updated_at":"2016-04-30T09:11:37Z","closed_at":null,"body":"Currently `this.get(user, 'validations.errors')` returns an array of error objects. But calling errors with [DS.Errors](http://emberjs.com/api/data/classes/DS.Errors.html) returns an Ember Object.\r\n\r\n```handlebars\r\n{{#each model.errors.username as |error|}}\r\n  <div class=\"error\">\r\n    {{error.message}}\r\n  </div>\r\n{{/each}}\r\n```\r\n\r\nIn this implementation, we can call `username` attribute on the object returned by `errors`. The most of the form addons conforms to this API. It would be nice if `ember-cp-validations` follows the same convention. It will make the integration with form addons much easier."},"comment":{"url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/comments/215948348","html_url":"https://github.com/offirgolan/ember-cp-validations/issues/175#issuecomment-215948348","issue_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/175","id":215948348,"user":{"login":"musaffa","id":294616,"avatar_url":"https://avatars.githubusercontent.com/u/294616?v=3","gravatar_id":"","url":"https://api.github.com/users/musaffa","html_url":"https://github.com/musaffa","followers_url":"https://api.github.com/users/musaffa/followers","following_url":"https://api.github.com/users/musaffa/following{/other_user}","gists_url":"https://api.github.com/users/musaffa/gists{/gist_id}","starred_url":"https://api.github.com/users/musaffa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/musaffa/subscriptions","organizations_url":"https://api.github.com/users/musaffa/orgs","repos_url":"https://api.github.com/users/musaffa/repos","events_url":"https://api.github.com/users/musaffa/events{/privacy}","received_events_url":"https://api.github.com/users/musaffa/received_events","type":"User","site_admin":false},"created_at":"2016-04-30T09:11:37Z","updated_at":"2016-04-30T09:11:37Z","body":"> If an attribute does not have any validators, then it will not be part of the validations.attrs object\r\n\r\nIs it possible to check for the presence of any specific validator on an attribute. For example, I want to determine whether the field is required (to put a * in the label) dynamically based the presence of the `Presence` validator."}}