Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Basically, I have a `Model` type that has configurable `primaryKey`. This is my current implementation that appears broken—I'm guessing the better way to do this would be to build the `primaryKey` property in `init`.
- ```javascript
- var Model = Ember.Object.extend({
- primaryKey: function() {
- return this.get(this.constructor.primaryKey);
- }.property().volatile(),
- isNew: Ember.computed.none('primaryKey')
- }).reopenClass({
- primaryKey: 'id'
- });
- var MyModel = Model.extend().reopenClass({
- primaryKey: 'uuid'
- });
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement