Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Really though, fix type & options defaults for attr & arrayAttr

  • Loading branch information...
commit 32bc5192be4b110c7301d64a61139017a1355613 1 parent 0020e92
@bschaeffer authored
View
10 packages/ember-ohm/lib/attributes/array_attribute.js
@@ -108,9 +108,13 @@ didChangeObserver = function(changes, key, opts) {
Ohm.arrayAttr = function(type, options) {
var defaults, _metaAtts;
- if (arguments.length <= 1) {
- options = type;
- type = 'default';
+ if (arguments.length !== 2) {
+ if (typeof type === 'object') {
+ options = type;
+ type = 'default';
+ } else if (typeof type === 'undefined') {
+ type = 'default';
+ }
}
// Merge the options with the defaults, set the meta
View
10 packages/ember-ohm/lib/attributes/attribute.js
@@ -38,9 +38,13 @@ deserialize = function(type, options, value) { return value; };
Ohm.attr = function(type, options) {
var defaults, _metaAtts;
- if (arguments.length <= 1) {
- options = type;
- type = 'default';
+ if (arguments.length !== 2) {
+ if (typeof type === 'object') {
+ options = type;
+ type = 'default';
+ } else if (typeof type === 'undefined') {
+ type = 'default';
+ }
}
// Merge the options with the defaults, set the meta
Please sign in to comment.
Something went wrong with that request. Please try again.