From 9c8d84bf2eb28984aead596152c6a916a1aecfba Mon Sep 17 00:00:00 2001 From: Alec Fenichel Date: Tue, 7 Mar 2017 10:39:38 -0500 Subject: [PATCH 1/2] Add support for validations as computed property --- addon/mixin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addon/mixin.js b/addon/mixin.js index 2fa174f2..c411afef 100644 --- a/addon/mixin.js +++ b/addon/mixin.js @@ -113,6 +113,8 @@ export default Mixin.create(setValidityMixin, { if (get(this, 'validations') === undefined) { this.validations = {}; + } else { + this.validations = get(this, 'validations'); } this.buildValidators(); From c9ef1f80c507b5cead864101573587f2e33c9da7 Mon Sep 17 00:00:00 2001 From: Alec Fenichel Date: Wed, 15 Mar 2017 20:39:04 -0400 Subject: [PATCH 2/2] Fix ember-getowner-polyfill deprecation --- addon/mixin.js | 3 +-- package.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/addon/mixin.js b/addon/mixin.js index c411afef..b7551e87 100644 --- a/addon/mixin.js +++ b/addon/mixin.js @@ -1,7 +1,6 @@ import Ember from 'ember'; import Errors from 'ember-validations/errors'; import Base from 'ember-validations/validators/base'; -import getOwner from 'ember-getowner-polyfill'; const { A: emberArray, @@ -42,7 +41,7 @@ const pushValidatableObject = function(model, property) { }; const lookupValidator = function(validatorName) { - let owner = getOwner(this); + let owner = Ember.getOwner(this); let service = owner.lookup('service:validations'); let validators = []; let cache; diff --git a/package.json b/package.json index b65cd989..0af3d864 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,7 @@ "ember-addon" ], "dependencies": { - "ember-cli-babel": "^5.1.6", - "ember-getowner-polyfill": "^1.0.0" + "ember-cli-babel": "^5.1.6" }, "ember-addon": { "configPath": "tests/dummy/config"