{"action":"created","issue":{"url":"https://api.github.com/repos/DockYard/ember-validations/issues/421","repository_url":"https://api.github.com/repos/DockYard/ember-validations","labels_url":"https://api.github.com/repos/DockYard/ember-validations/issues/421/labels{/name}","comments_url":"https://api.github.com/repos/DockYard/ember-validations/issues/421/comments","events_url":"https://api.github.com/repos/DockYard/ember-validations/issues/421/events","html_url":"https://github.com/DockYard/ember-validations/pull/421","id":170812187,"number":421,"title":"Multiple use of on('init') might cause inconsistencies","user":{"login":"yonjah","id":1829789,"avatar_url":"https://avatars.githubusercontent.com/u/1829789?v=3","gravatar_id":"","url":"https://api.github.com/users/yonjah","html_url":"https://github.com/yonjah","followers_url":"https://api.github.com/users/yonjah/followers","following_url":"https://api.github.com/users/yonjah/following{/other_user}","gists_url":"https://api.github.com/users/yonjah/gists{/gist_id}","starred_url":"https://api.github.com/users/yonjah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yonjah/subscriptions","organizations_url":"https://api.github.com/users/yonjah/orgs","repos_url":"https://api.github.com/users/yonjah/repos","events_url":"https://api.github.com/users/yonjah/events{/privacy}","received_events_url":"https://api.github.com/users/yonjah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-12T07:13:41Z","updated_at":"2016-08-13T03:02:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DockYard/ember-validations/pulls/421","html_url":"https://github.com/DockYard/ember-validations/pull/421","diff_url":"https://github.com/DockYard/ember-validations/pull/421.diff","patch_url":"https://github.com/DockYard/ember-validations/pull/421.patch"},"body":"I don't have a concrete issue, but I was looking for some  other stuff and noticed this code -\r\n https://github.com/DockYard/ember-validations/blob/master/addon/validators/base.js#L16\r\n\r\nThe base object is calling multiple functions using `on init`.\r\nSome of this functions are relying on other function on the `on init` process to finish (like `pushConditionalDependentValidationKeys` that has to run before `addObserversForDependentValidationKeys` ).\r\nBut since the execution order of `on init` is [not guaranteed](http://notmessenger.com/proper-use-of-ember-on/)  this create a very fragile code.\r\n\r\nI made this pull request to fix this issue.\r\nI couldn't  get the automatic test to work so a more careful examination of this fix might be necessary .\r\n\r\nP.S - On another look I think the `pushDependentValidationKeyToModel`  is not really doing any thing so I removed it. It treated model.dependentValidationKeys as an object even it was an array, and it tries to add `this property` to it even though it was add in the main `init` function\r\n"},"comment":{"url":"https://api.github.com/repos/DockYard/ember-validations/issues/comments/239598309","html_url":"https://github.com/DockYard/ember-validations/pull/421#issuecomment-239598309","issue_url":"https://api.github.com/repos/DockYard/ember-validations/issues/421","id":239598309,"user":{"login":"yonjah","id":1829789,"avatar_url":"https://avatars.githubusercontent.com/u/1829789?v=3","gravatar_id":"","url":"https://api.github.com/users/yonjah","html_url":"https://github.com/yonjah","followers_url":"https://api.github.com/users/yonjah/followers","following_url":"https://api.github.com/users/yonjah/following{/other_user}","gists_url":"https://api.github.com/users/yonjah/gists{/gist_id}","starred_url":"https://api.github.com/users/yonjah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yonjah/subscriptions","organizations_url":"https://api.github.com/users/yonjah/orgs","repos_url":"https://api.github.com/users/yonjah/repos","events_url":"https://api.github.com/users/yonjah/events{/privacy}","received_events_url":"https://api.github.com/users/yonjah/received_events","type":"User","site_admin":false},"created_at":"2016-08-13T03:02:18Z","updated_at":"2016-08-13T03:02:18Z","body":"I reverted most of the changes only aggregating everything into a single `on('init')`\r\nmethod. There might be some benefits in changing that and moving away from `on('init')` use in the base class but this should probably be as part of a larger change that will consider the entire class API "}}
{"actor":{"display_login":"yonjah"}}