1
0
Fork 0

Marked old Model.extend syntax for deprecation.

This commit is contained in:
Alan Plum 2014-07-09 12:00:28 +02:00
parent 2d6a0f2a73
commit 0b97f4731d
2 changed files with 7 additions and 0 deletions

View File

@ -12,6 +12,7 @@ migrations will also be detailed here.
## 2.2
* Foxx: The usage of `controller.collection` is no longer suggested, it will be deprecated in the next version. Please use `appContext.collection` instead.
* Foxx: The usage of `Model.extend({}, {attributes: {}})` is no longer suggested, it will be deprecated in the next version. Please use `Model.extend({schema: {}})` instead.
* Foxx: The usage of `apps` in manifest files is no longer possible, please use `controllers` instead.
* Graph: The usage of the modules `org/arangodb/graph` and `org/arangodb/graph-blueprint` is no longer suggested, it will be deprecated in the next version. Please use module `org/arangodb/general-graph` instead.
* Graph: The module `org/arangodb/graph` will now load the module `org/arangodb/graph-blueprint`.
@ -30,6 +31,7 @@ migrations will also be detailed here.
## 2.3
* Foxx: `controller.collection` is now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `appContext.collection` instead.
* Foxx: `Model.extend({}, {attributes: {}})` is now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `Model.extend({schema: {}})` instead.
* Graph: The modules `org/arangodb/graph` and `org/arangodb/graph-blueprint` are now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use module `org/arangodb/general-graph` instead.
* AQL: The function `PATHS` is now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `GRAPH_PATHS` instead.
* AQL: The function `SHORTEST_PATH` is now deprecated, it will raise a warning if you use it. To suppress the warning, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `GRAPH_SHORTEST_PATH` instead.
@ -45,6 +47,7 @@ migrations will also be detailed here.
## 2.4
* Foxx: `controller.collection` is no longer available by default. If you still want to use it, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `appContext.collection` instead.
* Foxx: `Model.extend({}, {attributes: {}})` is no longer available by default. If you still want to use it, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `Model.extend({schema: {}})` instead.
* Graph: The modules `org/arangodb/graph` and `org/arangodb/graph-blueprint` are no longer available by default. If you still want to use them, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use module `org/arangodb/general-graph` instead.
* AQL: The function `PATHS` is no longer available by default. If you still want to use it, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `GRAPH_PATHS` instead.
* AQL: The function `SHORTEST_PATH` is no longer available by default. If you still want to use it, please start `arangod` with the option `--server.default-api-compatibility 20200`. Please use `GRAPH_SHORTEST_PATH` instead.
@ -60,6 +63,7 @@ migrations will also be detailed here.
## 2.5
* Foxx: `controller.collection` has been removed entirely. Please use `appContext.collection` instead.
* Foxx: `Model.extend({}, {attributes: {}})` has been removed entirely. Please use `Model.extend({schema: {}})` instead.
* Graph: The modules `org/arangodb/graph` and `org/arangodb/graph-blueprint` have been removed entirely. Please use module `org/arangodb/general-graph` instead.
* AQL: The function `PATHS` has been removed entirely. Please use `GRAPH_PATHS` instead.
* AQL: The function `SHORTEST_PATH` has been removed entirely. Please use `GRAPH_SHORTEST_PATH` instead.

View File

@ -70,6 +70,7 @@ excludeExtraAttributes = function (attributes, Model) {
_.keys(Model.prototype.schema)
);
} else {
// deprecated
extraAttributeNames = _.difference(
_.keys(metadataSchema),
_.keys(Model.attributes)
@ -124,6 +125,7 @@ Model = function (attributes) {
}
);
} else if (instance.constructor.attributes) {
// deprecated
if (attributes) {
instance.attributes = _.pick(
attributes,
@ -181,6 +183,7 @@ _.extend(Model, {
properties[attributeName] = {type: type};
});
} else {
// deprecated
_.each(this.attributes, function (attribute, attributeName) {
if (typeof attribute === 'string') {
properties[attributeName] = {type: attribute};