Permalink
Browse files

utilize the new Computed#readOnly

  • Loading branch information...
1 parent 1b26454 commit 75790544abb5bd1707028b74a8d8777c5a236b72 @stefanpenner stefanpenner committed Mar 17, 2013
Showing with 1 addition and 4 deletions.
  1. +1 −4 packages/ember-data/lib/system/model/model.js
@@ -6,11 +6,8 @@ var LoadPromise = DS.LoadPromise; // system/mixins/load_promise
var get = Ember.get, set = Ember.set, none = Ember.isNone, 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();
baliw
baliw Mar 19, 2013

This update is failing with Ember 1.0.0-RC1. I get the following in the console.

Uncaught TypeError: Object [object Object] has no method 'readOnly'

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

5 comments on commit 7579054

@intuitivepixel
Contributor

I'm getting the same error using ember-data at:
// Last commit: 57d6c01 (2013-03-18 11:27:29 -0700)

@rlivsey

readOnly is in ember master.

If you're using the latest ember-data you probably want to be tracking the latest ember master.

@stefanpenner
Owner

Yup readOnly is on ember master. Sorry about that. (we really need to push an RC2)

@benkonrath

@stefanpenner An RC2 for Ember would be great. Fixed target versions to develop apps with makes life easier. :-)

@stefanpenner
Owner

RC2 is out

Please sign in to comment.