Skip to content

Commit

Permalink
Merge pull request #20 from mhlaws/deprecated-container-for-getowner-…
Browse files Browse the repository at this point in the history
…polyfill

suggested resolution for deprecation causes 2 tests to fail
  • Loading branch information
toddjordan committed Feb 10, 2016
2 parents cc742f4 + ab5fbd6 commit 0c02594
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addon/components/dynamic-form.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import getOwner from 'ember-getowner-polyfill';

const TYPE_MAP = {
validator: {
Expand Down Expand Up @@ -44,7 +45,7 @@ const DynamicForm = Ember.Component.extend({
const newSchema = _.reduce(optionFields, (result, val, key) => {
if(val['filter-rules']) {
val['filter-rules'].forEach((element) => {
const filterRule = this.container.lookup(`${element}:dynamic-forms.filter-rules`);
const filterRule = getOwner(this).lookup(`${element}:dynamic-forms.filter-rules`);
filterRule.filter(key, result);
});
}
Expand All @@ -71,7 +72,7 @@ const DynamicForm = Ember.Component.extend({
},

_replaceKeywordsWithFunctions(schemaObj) {
const container = this.container;
const container = getOwner(this);
const replaceWithFunction = function (object, value, key) {
if (TYPE_MAP.hasOwnProperty(key) && typeof value === 'string') {
const type = TYPE_MAP[key];
Expand Down
1 change: 1 addition & 0 deletions package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"ember-disable-prototype-extensions": "^1.0.0",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"ember-getowner-polyfill": "1.0.0",
"ember-resolver": "^2.0.3",
"ember-try": "~0.0.8"
},
Expand Down

0 comments on commit 0c02594

Please sign in to comment.