Skip to content

Commit

Permalink
Merge pull request #819 from stefanpenner/upgradeEmberAndReadOnly
Browse files Browse the repository at this point in the history
Upgrade ember so Computed#readOnly is available
  • Loading branch information
stefanpenner committed Mar 18, 2013
2 parents 4a18479 + 9df9b44 commit 57d6c01
Show file tree
Hide file tree
Showing 5 changed files with 2,391 additions and 1,806 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ source "https://rubygems.org"
gem "rake-pipeline", :git => "https://github.com/livingsocial/rake-pipeline.git"
gem "ember-dev", :git => "https://github.com/emberjs/ember-dev.git", :branch => "master"

# Change to "1.0.0.rc1.2" to test rc1
gem "ember-source", "1.0.0.pre4.2"
gem "ember-source", "1.0.0.rc1.4"
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/emberjs/ember-dev.git
revision: a0e3e6816bfd093d7a732b77d7f08395ab48a61e
revision: 2f17d36959adb2dc7b172fe9c8b34a4b99725507
branch: master
specs:
ember-dev (0.1)
Expand All @@ -17,7 +17,7 @@ GIT

GIT
remote: https://github.com/livingsocial/rake-pipeline.git
revision: ee992cbcda5172075062be035bcbef2cf1b0ff5d
revision: 65b1e744defa208e313703d89f3453447cc103b2
specs:
rake-pipeline (0.8.0)
json
Expand All @@ -29,21 +29,21 @@ GEM
specs:
colored (1.2)
diff-lcs (1.2.1)
ember-source (1.0.0.pre4.2)
handlebars-source (>= 1.0.0.rc2, < 1.0.0.rc3)
ember-source (1.0.0.rc1.4)
handlebars-source (>= 1.0.0.rc3, < 1.0.0.rc4)
execjs (1.4.0)
multi_json (~> 1.0)
grit (2.5.0)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
posix-spawn (~> 0.3.6)
handlebars-source (1.0.0.rc.2)
handlebars-source (1.0.0.rc.3)
json (1.7.7)
kicker (2.6.1)
listen
listen (0.7.3)
mime-types (1.21)
multi_json (1.6.1)
multi_json (1.7.0)
posix-spawn (0.3.6)
rack (1.5.2)
rake (10.0.3)
Expand All @@ -60,5 +60,5 @@ PLATFORMS

DEPENDENCIES
ember-dev!
ember-source (= 1.0.0.pre4.2)
ember-source (= 1.0.0.rc1.4)
rake-pipeline!
8 changes: 4 additions & 4 deletions packages/ember-data/lib/system/application_ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Ember.onLoad('Ember.Application', function(Application) {
name: "store",

initialize: function(container, application) {
container.register('store', 'main', application.Store);
application.register('store:main', application.Store);

// Eagerly generate the store so defaultStore is populated.
// TODO: Do this in a finisher hook
Expand All @@ -80,9 +80,9 @@ Ember.onLoad('Ember.Application', function(Application) {
Application.initializer({
name: "injectStore",

initialize: function(container) {
container.typeInjection('controller', 'store', 'store:main');
container.typeInjection('route', 'store', 'store:main');
initialize: function(container, application) {
application.inject('controller', 'store', 'store:main');
application.inject('route', 'store', 'store:main');
}
});
}
Expand Down
5 changes: 1 addition & 4 deletions packages/ember-data/lib/system/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ var LoadPromise = DS.LoadPromise; // system/mixins/load_promise
var get = Ember.get, set = Ember.set, map = Ember.EnumerableUtils.map;

var retrieveFromCurrentState = Ember.computed(function(key, value) {
if (arguments.length > 1) {
throw new Error('Cannot Set: ' + key + ' on: ' + this.toString() );
}
return get(get(this, 'stateManager.currentState'), key);
}).property('stateManager.currentState');
}).property('stateManager.currentState').readOnly();

DS.Model = Ember.Object.extend(Ember.Evented, LoadPromise, {
isLoaded: retrieveFromCurrentState,
Expand Down
Loading

0 comments on commit 57d6c01

Please sign in to comment.