Skip to content

Commit

Permalink
Merge branch 'master' into friendly-errors
Browse files Browse the repository at this point in the history
Conflicts:
	addon/adapters/rest-adapter.js
  • Loading branch information
nikz committed Dec 4, 2015
2 parents a687084 + eaa3652 commit 66db2a9
Show file tree
Hide file tree
Showing 122 changed files with 1,207 additions and 937 deletions.
31 changes: 27 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
# http://editorconfig.org
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.js]
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false
indent_style = space
indent_size = 2

[*.css]
indent_style = space
indent_size = 2

[*.html]
indent_style = space
indent_size = 2

[*.{diff,md}]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions .ember-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
}
14 changes: 14 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
bower_components/
tests/
tmp/
dist/

.bowerrc
.editorconfig
.ember-cli
.travis.yml
.npmignore
**/.gitkeep
bower.json
Brocfile.js
testem.json
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: node_js
sudo: required
dist: trusty
node_js:
- "0.10"
- "4.2"
before_install:
- "npm config set spin false"
- "npm install -g npm@^2"
Expand Down
3 changes: 3 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["tmp", "dist"]
}
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@

### Master

### Release 2.2.0 (November 17, 2015)
- [#3937](https://github.com/emberjs/data/pull/3937) [BUGFIX beta] Warn instead of asserting when a mapped key doesn't mat…
- [#3868](https://github.com/emberjs/data/pull/3868) Reset changed attributes when matching data is pushed
- [#3875](https://github.com/emberjs/data/pull/3875) [BUGFIX beta] serialize type for embedded, polymorphic belongsTo
- [#3900](https://github.com/emberjs/data/pull/3900) [DOC fix] errors pointers should start with a /
- [#3905](https://github.com/emberjs/data/pull/3905) [BUGFIX release] Update the dependencies for Ember 2.x
- [#3909](https://github.com/emberjs/data/pull/3909) [BUGFIX beta] Correctly handle object level errors in json api
- [#3910](https://github.com/emberjs/data/pull/3910) [BUGFIX release] Normalize attrs keys
- [#3912](https://github.com/emberjs/data/pull/3912) Use public API for container/registry when possible.]
- [#3835](https://github.com/emberjs/data/pull/3835) [BUGFIX] extract polymorphic belongsTo in RESTSerializer
- [#3887](https://github.com/emberjs/data/pull/3887) [BUGFIX release] update ember-inflector to resolve default Inflector …
- [#3888](https://github.com/emberjs/data/pull/3888) [BUGFIX release] import from ember-inflector to use the default instance
- [#3832](https://github.com/emberjs/data/pull/3832) Fix API docs for JSONAPISerializer.normalize
- [#3837](https://github.com/emberjs/data/pull/3837) [BUGFIX] Attribute/relationship named "type" of embedded record is considered before normalization
- [#3846](https://github.com/emberjs/data/pull/3846) [BUGFIX beta] Attribute/relationship named "type" of primary record i…
- [#3847](https://github.com/emberjs/data/pull/3847) [BUGFIX beta] JSONAPI serializer not respecting 'attrs' hash
- [#3857](https://github.com/emberjs/data/pull/3857) [BUGFIX beta] rollbackAttributes() works after multiple failed saves
- [#3859](https://github.com/emberjs/data/pull/3859) [BUGFIX beta] Correctly handle invalid errors without payload or pointer
- [#3861](https://github.com/emberjs/data/pull/3861) [BUGFIX beta] Assert that an array is returned from the normalized re…
- [#3867](https://github.com/emberjs/data/pull/3867) Allow serializers to normalize response, remove old internal serializers code
- [#3697](https://github.com/emberjs/data/pull/3697) Fix typo in CHANGELOG
- [#3215](https://github.com/emberjs/data/pull/3215) remove Map/MapWithDefault polyfills, use Ember's ones
- [#3711](https://github.com/emberjs/data/pull/3711) Explicitly set length after setting a new content property
- [#3714](https://github.com/emberjs/data/pull/3714) Update the location of the custom store in the API doc example
- [#3699](https://github.com/emberjs/data/pull/3699) [refactor] add some tests asserting polymorphic relationships can be …
- [#3751](https://github.com/emberjs/data/pull/3751) Remove normalizePayload, associated docs, and mention of functionality.
- [#3732](https://github.com/emberjs/data/pull/3732) follow up fixes for #3701
- [#3746](https://github.com/emberjs/data/pull/3746) Improve test coverage for store#findRecord()
- [#3722](https://github.com/emberjs/data/pull/3722) Shape and cleanup
- [#3739](https://github.com/emberjs/data/pull/3739) store example should use findRecord()
- [#3734](https://github.com/emberjs/data/pull/3734) Revert "Explicitly set length after setting a new content property"
- [#3783](https://github.com/emberjs/data/pull/3783) Update changelog for 2.0.1 release
- [#3771](https://github.com/emberjs/data/pull/3771) update coalesceFindRequests doc for JSONAPIAdapter
- [#3774](https://github.com/emberjs/data/pull/3774) Fix embedded key serialization bug and refactor key serialization
- [#3773](https://github.com/emberjs/data/pull/3773) Break apart embedded serialize methods in EmbeddedRecordsMixin
- [#3777](https://github.com/emberjs/data/pull/3777) Remove unused test module
- [#3788](https://github.com/emberjs/data/pull/3788) Port pr #3725 to the release 2.0 branch
- [#3795](https://github.com/emberjs/data/pull/3795) Trigger an assertion when calling `findRecord` with falsy (except 0) id
- [#3808](https://github.com/emberjs/data/pull/3808) Update internal-model.js
- [#3814](https://github.com/emberjs/data/pull/3814) [BUGFIX] Do not deserialize when a relationship named `type` exists
- [#3816](https://github.com/emberjs/data/pull/3816) run optional feature tests on AppVeyor
- [#3817](https://github.com/emberjs/data/pull/3817) Update the changelog for Ember Data 2.1.0

### Release 1.13.14 (October 18, 2015)
- [#3665](https://github.com/emberjs/data/pull/3665) [BUGFIX beta] Fix usage of registry for 2.1.0+.
- [#3825](https://github.com/emberjs/data/pull/3825) [BUGFIX] Restore IE8 compatibility by using Ember.create
Expand Down
28 changes: 14 additions & 14 deletions addon/adapters/build-url-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default Ember.Mixin.create({
@param {Object} query object of query parameters to send for query requests.
@return {String} url
*/
buildURL: function(modelName, id, snapshot, requestType, query) {
buildURL(modelName, id, snapshot, requestType, query) {
switch (requestType) {
case 'findRecord':
return this.urlForFindRecord(id, modelName, snapshot);
Expand Down Expand Up @@ -83,7 +83,7 @@ export default Ember.Mixin.create({
@param {String} id
@return {String} url
*/
_buildURL: function(modelName, id) {
_buildURL(modelName, id) {
var url = [];
var host = get(this, 'host');
var prefix = this.urlPrefix();
Expand Down Expand Up @@ -112,7 +112,7 @@ export default Ember.Mixin.create({
* @param {DS.Snapshot} snapshot
* @return {String} url
*/
urlForFindRecord: function(id, modelName, snapshot) {
urlForFindRecord(id, modelName, snapshot) {
return this._buildURL(modelName, id);
},

Expand All @@ -121,7 +121,7 @@ export default Ember.Mixin.create({
* @param {String} modelName
* @return {String} url
*/
urlForFindAll: function(modelName) {
urlForFindAll(modelName) {
return this._buildURL(modelName);
},

Expand All @@ -131,7 +131,7 @@ export default Ember.Mixin.create({
* @param {String} modelName
* @return {String} url
*/
urlForQuery: function(query, modelName) {
urlForQuery(query, modelName) {
return this._buildURL(modelName);
},

Expand All @@ -141,7 +141,7 @@ export default Ember.Mixin.create({
* @param {String} modelName
* @return {String} url
*/
urlForQueryRecord: function(query, modelName) {
urlForQueryRecord(query, modelName) {
return this._buildURL(modelName);
},

Expand All @@ -152,7 +152,7 @@ export default Ember.Mixin.create({
* @param {Array} snapshots
* @return {String} url
*/
urlForFindMany: function(ids, modelName, snapshots) {
urlForFindMany(ids, modelName, snapshots) {
return this._buildURL(modelName);
},

Expand All @@ -162,7 +162,7 @@ export default Ember.Mixin.create({
* @param {String} modelName
* @return {String} url
*/
urlForFindHasMany: function(id, modelName) {
urlForFindHasMany(id, modelName) {
return this._buildURL(modelName, id);
},

Expand All @@ -172,7 +172,7 @@ export default Ember.Mixin.create({
* @param {String} modelName
* @return {String} url
*/
urlForFindBelongsTo: function(id, modelName) {
urlForFindBelongsTo(id, modelName) {
return this._buildURL(modelName, id);
},

Expand All @@ -182,7 +182,7 @@ export default Ember.Mixin.create({
* @param {DS.Snapshot} snapshot
* @return {String} url
*/
urlForCreateRecord: function(modelName, snapshot) {
urlForCreateRecord(modelName, snapshot) {
return this._buildURL(modelName);
},

Expand All @@ -193,7 +193,7 @@ export default Ember.Mixin.create({
* @param {DS.Snapshot} snapshot
* @return {String} url
*/
urlForUpdateRecord: function(id, modelName, snapshot) {
urlForUpdateRecord(id, modelName, snapshot) {
return this._buildURL(modelName, id);
},

Expand All @@ -204,7 +204,7 @@ export default Ember.Mixin.create({
* @param {DS.Snapshot} snapshot
* @return {String} url
*/
urlForDeleteRecord: function(id, modelName, snapshot) {
urlForDeleteRecord(id, modelName, snapshot) {
return this._buildURL(modelName, id);
},

Expand All @@ -215,7 +215,7 @@ export default Ember.Mixin.create({
@param {String} parentURL
@return {String} urlPrefix
*/
urlPrefix: function(path, parentURL) {
urlPrefix(path, parentURL) {
var host = get(this, 'host');
var namespace = get(this, 'namespace');
var url = [];
Expand Down Expand Up @@ -277,7 +277,7 @@ export default Ember.Mixin.create({
@param {String} modelName
@return {String} path
**/
pathForType: function(modelName) {
pathForType(modelName) {
var camelized = Ember.String.camelize(modelName);
return Ember.String.pluralize(camelized);
}
Expand Down
8 changes: 4 additions & 4 deletions addon/adapters/json-api-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default RESTAdapter.extend({
@param {Object} options
@return {Object}
*/
ajaxOptions: function(url, type, options) {
ajaxOptions(url, type, options) {
let hash = this._super(...arguments);

if (hash.contentType) {
Expand Down Expand Up @@ -96,7 +96,7 @@ export default RESTAdapter.extend({
@param {Array} snapshots
@return {Promise} promise
*/
findMany: function(store, type, ids, snapshots) {
findMany(store, type, ids, snapshots) {
var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');
return this.ajax(url, 'GET', { data: { filter: { id: ids.join(',') } } });
},
Expand All @@ -106,7 +106,7 @@ export default RESTAdapter.extend({
@param {String} modelName
@return {String} path
**/
pathForType: function(modelName) {
pathForType(modelName) {
var dasherized = Ember.String.dasherize(modelName);
return Ember.String.pluralize(dasherized);
},
Expand All @@ -119,7 +119,7 @@ export default RESTAdapter.extend({
@param {DS.Snapshot} snapshot
@return {Promise} promise
*/
updateRecord: function(store, type, snapshot) {
updateRecord(store, type, snapshot) {
var data = {};
var serializer = store.serializerFor(type.modelName);

Expand Down
Loading

0 comments on commit 66db2a9

Please sign in to comment.