active-model-adapter-source 1.13.2 → 1.13.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDA1ZDg0OTk5YTgxMGNhNTJjZjczOWZjNjM3NTEzYzk5YWU0OGM3MA==
4
+ MjcyOWE1YjIxMTgwYjQ5NjU3ZjAwNDA3NmY5NjQ0NDkzMWYxMzQ1MQ==
5
5
  data.tar.gz: !binary |-
6
- NjcxMjMxMDUzNTI0YmIzYmRiYWNmZjU1YmU5M2ZjMjhkZjg4ZjM4OA==
6
+ OWE2MWIwYzAwNjFkYTAzZjRkODYwMGQ1ZDc1MDY0OGNiMjk5NzAwNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmQ0ZWMzMzkzOTAwNzZiMTA5ZGIxMjhlYjRiOTg5ZWM4YjMxZjBlOTdmZmM5
10
- N2YxYzYzMWI0MjVkZWM0ZjAwOTJlODliY2M5M2VjNzI2ODQ3N2ZjZGViMjc5
11
- YTFjZmU0OGM0ZmIzNTA0MTdmMjUwM2I0ZjQ4NzFhMTMyNjhjNmE=
9
+ NTlmOGRkMTcyNWFmZDEzMTViMjBjNGFmZTdiNzEwMjliZDcwNDE0N2NjMjVj
10
+ MDhiMTFiZDRlZDhhZjI4NjhmMDczY2JiYjA0OTBhYjFhOGI0MzE2MjllZjA3
11
+ Yzk1MmJjMzM2MTZjNjEyYzI2ODEzNzNmMzQ4MGJlNGFjNjE4NmY=
12
12
  data.tar.gz: !binary |-
13
- MjFhZDM0NGZmMWQ4NTc1Yzk3ZGI1NTBmMzNkYmYyMzQ1NGRhYjBlZGM1YzJm
14
- NTMzMzYyMWYzZGI5NTg2MDU5ZDg0OWQ2NTA5ODQ1NWMwYzFlNzJmNzcwM2M0
15
- NWE1YmM0OTI3NjczOTlmMzQwNmJhZDgwY2RkMDBlYmMyNTlkNWU=
13
+ OWM1MmEwYTFhMmQ1MzVjODIwZWY1ODY4NjM0NWQ4YzgwNjczMGI2NTcyYzVk
14
+ MzM4YTk0MjVmMGY0NWRjMTNmNjBkZjM4NDk0YzZiNjdhYmFkZGM2YWEwNTk1
15
+ OTE0NmMwYjRkOTU2ZTFkYWZlY2U2MmMwMGM1N2FmMWRlNmViYTc=
@@ -5,7 +5,7 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 1.13.2
8
+ * @version 1.13.3
9
9
  */
10
10
 
11
11
  (function() {
@@ -210,18 +210,18 @@ define("ember-data", ["exports"], function (exports) {
210
210
  exports["default"] = DS;
211
211
  });
212
212
  define('active-model-adapter', ['exports', 'ember', 'ember-data'], function (exports, _ember, _emberData) {
213
+ var InvalidError = _emberData["default"].InvalidError;
214
+ var errorsHashToArray = _emberData["default"].errorsHashToArray;
215
+ var RESTAdapter = _emberData["default"].RESTAdapter;
216
+ var _Ember$String = _ember["default"].String;
217
+ var pluralize = _Ember$String.pluralize;
218
+ var decamelize = _Ember$String.decamelize;
219
+ var underscore = _Ember$String.underscore;
213
220
 
214
221
  /**
215
- @module active-model-adapter
222
+ @module ember-data
216
223
  */
217
224
 
218
- var decamelize = _ember["default"].String.decamelize;
219
- var underscore = _ember["default"].String.underscore;
220
- var pluralize = _ember["default"].String.pluralize;
221
- var RESTAdapter = _emberData["default"].RESTAdapter;
222
- var InvalidError = _emberData["default"].InvalidError;
223
- var errorsHashToArray = _emberData["default"].errorsHashToArray;
224
-
225
225
  /**
226
226
  The ActiveModelAdapter is a subclass of the RESTAdapter designed to integrate
227
227
  with a JSON API that uses an underscored naming convention instead of camelCasing.
@@ -341,11 +341,9 @@ define('active-model-adapter', ['exports', 'ember', 'ember-data'], function (exp
341
341
  content was not semantically correct or meaningful per the API.
342
342
  For more information on 422 HTTP Error code see 11.2 WebDAV RFC 4918
343
343
  https://tools.ietf.org/html/rfc4918#section-11.2
344
- @method handleResponse
345
- @param {Number} status
346
- @param {Object} headers
347
- @param {Object} payload
348
- @return {Object | DS.AdapterError} response
344
+ @method ajaxError
345
+ @param {Object} jqXHR
346
+ @return error
349
347
  */
350
348
  handleResponse: function (status, headers, payload) {
351
349
  if (this.isInvalid(status, headers, payload)) {
@@ -358,32 +356,22 @@ define('active-model-adapter', ['exports', 'ember', 'ember-data'], function (exp
358
356
  }
359
357
  });
360
358
 
361
- if (!errorsHashToArray) {
362
- ActiveModelAdapter.reopen({
363
- ajaxError: function (jqXHR) {
364
- var error = this._super.apply(this, arguments);
365
-
366
- if (jqXHR && jqXHR.status === 422) {
367
- var response = _ember["default"].$.parseJSON(jqXHR.responseText);
368
- return new InvalidError(response);
369
- } else {
370
- return error;
371
- }
372
- }
373
- });
374
- }
375
-
376
359
  exports["default"] = ActiveModelAdapter;
377
360
  });
378
- define('active-model-serializer', ['exports', 'ember', 'ember-data'], function (exports, _ember, _emberData) {
379
- var forEach = _ember["default"].EnumerableUtils.forEach;
361
+ define('active-model-serializer', ['exports', 'ember-data', 'ember'], function (exports, _emberData, _ember) {
362
+
363
+ /**
364
+ @module ember-data
365
+ */
366
+
380
367
  var _Ember$String = _ember["default"].String;
381
368
  var singularize = _Ember$String.singularize;
382
- var camelize = _Ember$String.camelize;
383
369
  var classify = _Ember$String.classify;
384
370
  var decamelize = _Ember$String.decamelize;
371
+ var camelize = _Ember$String.camelize;
385
372
  var underscore = _Ember$String.underscore;
386
373
  var RESTSerializer = _emberData["default"].RESTSerializer;
374
+ var normalizeModelName = _emberData["default"].normalizeModelName;
387
375
 
388
376
  /**
389
377
  The ActiveModelSerializer is a subclass of the RESTSerializer designed to integrate
@@ -546,9 +534,7 @@ define('active-model-serializer', ['exports', 'ember', 'ember-data'], function (
546
534
  if (_ember["default"].isNone(belongsTo)) {
547
535
  json[jsonKey] = null;
548
536
  } else {
549
- json[jsonKey] = classify(belongsTo.modelName).replace(/(\/)([a-z])/g, function (match, separator, chr) {
550
- return match.toUpperCase();
551
- }).replace('/', '::');
537
+ json[jsonKey] = classify(belongsTo.modelName).replace('/', '::');
552
538
  }
553
539
  },
554
540
 
@@ -632,6 +618,8 @@ define('active-model-serializer', ['exports', 'ember', 'ember-data'], function (
632
618
 
633
619
  if (this.keyForRelationship) {
634
620
  typeClass.eachRelationship(function (key, relationship) {
621
+ var _this = this;
622
+
635
623
  var payloadKey, payload;
636
624
  if (relationship.options.polymorphic) {
637
625
  payloadKey = this.keyForAttribute(key, 'deserialize');
@@ -639,9 +627,8 @@ define('active-model-serializer', ['exports', 'ember', 'ember-data'], function (
639
627
  if (payload && payload.type) {
640
628
  payload.type = this.modelNameFromPayloadKey(payload.type);
641
629
  } else if (payload && relationship.kind === 'hasMany') {
642
- var self = this;
643
- forEach(payload, function (single) {
644
- single.type = self.modelNameFromPayloadKey(single.type);
630
+ payload.forEach(function (single) {
631
+ return single.type = _this.modelNameFromPayloadKey(single.type);
645
632
  });
646
633
  }
647
634
  } else {
@@ -661,18 +648,13 @@ define('active-model-serializer', ['exports', 'ember', 'ember-data'], function (
661
648
  }
662
649
  },
663
650
  modelNameFromPayloadKey: function (key) {
664
- var convertedFromRubyModule = camelize(singularize(key)).replace(/(^|\:)([A-Z])/g, function (match, separator, chr) {
665
- return match.toLowerCase();
666
- }).replace('::', '/');
667
- return this._super(convertedFromRubyModule);
651
+ var convertedFromRubyModule = singularize(key.replace('::', '/'));
652
+ return normalizeModelName(convertedFromRubyModule);
668
653
  }
669
654
  });
670
655
 
671
656
  exports["default"] = ActiveModelSerializer;
672
657
  });
673
- /**
674
- @module active-model-adapter
675
- */
676
658
  define('index', ['exports', './active-model-adapter', './active-model-serializer'], function (exports, _activeModelAdapter, _activeModelSerializer) {
677
659
  exports["default"] = _activeModelAdapter["default"];
678
660
  exports.ActiveModelAdapter = _activeModelAdapter["default"];
@@ -683,7 +665,7 @@ define("initializers/active-model-adapter", ["exports", "active-model-adapter",
683
665
  name: "active-model-adapter",
684
666
  initialize: function (registry, application) {
685
667
  registry.register("adapter:-active-model", _activeModelAdapter["default"]);
686
- registry.register("serializer:-active-model", _activeModelAdapterActiveModelSerializer["default"]);
668
+ registry.register("serializer:-active-model", _activeModelAdapterActiveModelSerializer["default"].extend({ isNewSerializerAPI: true }));
687
669
  }
688
670
  };
689
671
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "active-model-adapter",
3
- "version": "1.13.2",
4
- "repository": "https://github.com/ember-data/active-model-adapter.git",
3
+ "version": "1.13.3",
4
+ "repository": "",
5
5
  "description": "The default blueprint for ember-cli addons.",
6
6
  "directories": {
7
7
  "doc": "doc",
@@ -12,7 +12,6 @@
12
12
  "build": "ember build",
13
13
  "test": "ember try:testall"
14
14
  },
15
- "repository": "",
16
15
  "engines": {
17
16
  "node": ">= 0.10.0"
18
17
  },
@@ -25,13 +24,13 @@
25
24
  "broccoli-es3-safe-recast": "^2.0.0",
26
25
  "broccoli-funnel": "^0.2.3",
27
26
  "broccoli-merge-trees": "^0.2.1",
27
+ "broccoli-replace": "^0.3.1",
28
28
  "broccoli-stew": "^0.3.2",
29
29
  "ember-cli": "0.2.7",
30
30
  "ember-cli-app-version": "0.3.3",
31
31
  "ember-cli-content-security-policy": "0.4.0",
32
32
  "ember-cli-dependency-checker": "^1.0.0",
33
33
  "ember-cli-htmlbars": "0.7.6",
34
- "ember-cli-ic-ajax": "0.1.1",
35
34
  "ember-cli-inject-live-reload": "^1.3.0",
36
35
  "ember-cli-qunit": "0.3.13",
37
36
  "ember-cli-uglify": "^1.0.1",
@@ -39,8 +38,8 @@
39
38
  "ember-disable-prototype-extensions": "^1.0.0",
40
39
  "ember-disable-proxy-controllers": "^1.0.0",
41
40
  "ember-export-application-global": "^1.0.2",
42
- "ember-try": "0.0.6",
43
- "broccoli-replace": "^0.3.1"
41
+ "ember-try": "0.0.7",
42
+ "ember-watson": "^0.5.7"
44
43
  },
45
44
  "keywords": [
46
45
  "ember-addon"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-model-adapter-source
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.2
4
+ version: 1.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Terzic
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-06-18 00:00:00.000000000 Z
13
+ date: 2015-07-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ember-data-source