Created
November 21, 2014 00:58
-
-
Save dnegstad/f7ed84944849cd9e0e36 to your computer and use it in GitHub Desktop.
Read only attributes in Ember Data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
DS.ActiveModelSerializer.extend({ | |
serializeAttribute: function(record, json, key, attribute) { | |
if (attribute.options && attribute.options.readOnly) { | |
return; | |
} else { | |
this._super.apply(this, arguments); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment