Skip to content

Commit

Permalink
[BUGFIX beta] restore Ember.computed.collect
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Santero committed Dec 18, 2015
1 parent 4103099 commit 3c47522
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/ember-metal/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ import {
deprecatingAlias,
and,
or,
any,
collect
any
} from 'ember-metal/computed_macros';

computed.empty = empty;
Expand All @@ -154,7 +153,6 @@ computed.deprecatingAlias = deprecatingAlias;
computed.and = and;
computed.or = or;
computed.any = any;
computed.collect = collect;

import {
_suspendObserver,
Expand Down
4 changes: 3 additions & 1 deletion packages/ember-runtime/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ import {
filterBy,
uniq,
union,
intersect
intersect,
collect
} from 'ember-runtime/computed/reduce_computed_macros';

import Controller from 'ember-runtime/controllers/controller';
Expand Down Expand Up @@ -118,6 +119,7 @@ EmComputed.filterBy = filterBy;
EmComputed.uniq = uniq;
EmComputed.union = union;
EmComputed.intersect = intersect;
EmComputed.collect = collect;

Ember.String = EmberStringUtils;
Ember.Object = EmberObject;
Expand Down
19 changes: 19 additions & 0 deletions packages/ember-runtime/tests/main_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Ember from 'ember-runtime';

QUnit.module('ember-runtime/main');

QUnit.test('Ember.computed.collect', function() {
let MyObj = Ember.Object.extend({
props: Ember.computed.collect('foo', 'bar', 'baz')
});

let myObj = MyObj.create({
foo: 3,
bar: 5,
baz: 'asdf'
});

let propsValue = myObj.get('props');

deepEqual(propsValue, [3, 5, 'asdf']);
});

0 comments on commit 3c47522

Please sign in to comment.