Skip to content

Commit

Permalink
support Ember 3.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinJoyce committed Sep 23, 2019
1 parent 2e90172 commit 26e863f
Show file tree
Hide file tree
Showing 6 changed files with 1,022 additions and 1,093 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- '6'
- '10'

sudo: false
dist: trusty
Expand Down
11 changes: 8 additions & 3 deletions addon/-private/ember-internals.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import Ember from 'ember';

let __EMBER_METAL__;
if (Ember.__loader.registry['@ember/-internals/metal']) {
__EMBER_METAL__ = Ember.__loader.require('@ember/-internals/metal');
let emberMetalPaths = [
'@ember/-internals/metal', // ember-source from 3.10
'@ember/-internals/metal/index' // ember-source from 3.13
];
let metalPath = emberMetalPaths.find(path => Ember.__loader.registry[path]);
if (metalPath) {
__EMBER_METAL__ = Ember.__loader.require(metalPath);
}

export function getDependentKeys(descriptorOrDecorator) {
if (__EMBER_METAL__ && __EMBER_METAL__.descriptorForDecorator) {
let descriptor = __EMBER_METAL__.descriptorForDecorator(
descriptorOrDecorator
);
return descriptor._dependentKeys;
return descriptor._dependentKeys || [descriptor.altKey];
} else {
return descriptorOrDecorator._dependentKeys;
}
Expand Down
2 changes: 2 additions & 0 deletions addon/validations/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ function getCPDependentKeysFor(attribute, model, validations) {
dependentKeys.push('model.isDeleted');
}

dependentKeys = dependentKeys.filter(dependentKey => !!dependentKey);

dependentKeys = dependentKeys.map(d => {
return d.replace(/^model\./, `${ATTRS_MODEL}.`);
});
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"babel-eslint": "^8.2.6",
"bootstrap-sass": "^3.3.7",
"broccoli-asset-rev": "^2.7.0",
"ember-bootstrap": "^1.2.2",
"ember-cli": "~3.6.1",
"ember-bootstrap": "3.0.0-rc.3",
"ember-cli": "~3.12.0",
"ember-cli-app-version": "^3.1.3",
"ember-cli-autoprefixer": "^0.7.0",
"ember-cli-changelog": "0.3.4",
Expand Down Expand Up @@ -61,7 +61,7 @@
"ember-qunit": "^3.4.1",
"ember-qunit-nice-errors": "^1.2.0",
"ember-resolver": "^5.0.1",
"ember-source": "~3.8.0",
"ember-source": "~3.13.0",
"ember-source-channel-url": "^1.1.0",
"ember-test-selectors": "^0.3.8",
"ember-truth-helpers": "2.0.0",
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/validations/factory-general-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import DefaultMessages from 'dummy/validators/messages';
import PresenceValidator from 'dummy/validators/presence';
import LengthValidator from 'dummy/validators/length';
import { validator, buildValidations } from 'ember-cp-validations';
import { module, test } from 'qunit';
import { module, test, skip } from 'qunit';
import { setupTest } from 'ember-qunit';
import { ATTRS_MODEL } from 'ember-cp-validations/-private/symbols';

Expand Down Expand Up @@ -1040,7 +1040,8 @@ module('Integration | Validations | Factory - General', function(hooks) {
assert.equal(child.get('validations.errors.length'), 1);
});

test('call super in validations class with no super property', function(assert) {
// https://github.com/offirgolan/ember-cp-validations/pull/656
skip('call super in validations class with no super property', function(assert) {
// see https://github.com/offirgolan/ember-cp-validations/issues/149
assert.expect(1);

Expand Down

0 comments on commit 26e863f

Please sign in to comment.