Commit Graph

1852 Commits

Author SHA1 Message Date
Raymond Feng cd2bd34619 Make sure base properties/settings are merged into the submodel
See https://github.com/strongloop/loopback-datasource-juggler/issues/293
2015-02-07 11:15:28 -08:00
Raymond Feng e9c966227d Merge pull request #420 from aol-nnov/fkCustomDbType
Create model foreign key matching type of opposite part of relation (even if it has a custom field type)
2015-02-05 10:28:04 -08:00
Raymond Feng 90063bc222 Merge pull request #431 from strongloop/feature/fix-should-not-equal-perf
Fix the perf around should.not.equal for complex objects
2015-02-05 09:32:02 -08:00
Raymond Feng c9e78f6bd2 Fix the perf around should.not.equal for complex objects 2015-02-05 08:22:17 -08:00
Miroslav Bajtoš 8d338eade9 Merge tag 'v2.16.0'
2.16.0

 * Return 400 when client provides an incorrect value (Pradnya Baviskar)

 * Relax "id" checks in test/manipulation.test.js (Miroslav Bajtoš)

 * Fix typo (Raymond Feng)

 * test: undefined property values are preserved (Miroslav Bajtoš)

 * Remove undefined properties for create (Raymond Feng)

 * Update to `should` to the latest version 4.6.3 (Miroslav Bajtoš)

 * Relax the id equality test for mongodb object ids (Raymond Feng)
2015-02-05 12:47:37 +01:00
Miroslav Bajtoš 169e270925 Merge branch 'release/2.16.0' into production 2015-02-05 12:47:35 +01:00
Miroslav Bajtoš aca258f7e0 v2.16.0 2015-02-05 12:47:33 +01:00
Miroslav Bajtoš 2e2e01cc5c Merge pull request #430 from PradnyaBaviskar/issue709
Return 400 when client provides an incorrect value
2015-02-05 12:42:54 +01:00
Pradnya Baviskar be37fb4388 Return 400 when client provides an incorrect value 2015-02-05 16:58:42 +05:30
Andrey Loukhnov 3ce6a2618f testcase for #420 2015-02-05 10:12:34 +03:00
Miroslav Bajtoš c013ae4d38 Merge pull request #428 from strongloop/fix/manipulation-tests-in-mongodb
Relax "id" checks in test/manipulation.test.js
2015-02-04 19:27:12 +01:00
Miroslav Bajtoš 04083678c0 Relax "id" checks in test/manipulation.test.js
Use `eql` instead of `equal` to support non-scalar id values
used by MongoDB connector.
2015-02-04 19:20:56 +01:00
Miroslav Bajtoš 4889443ed0 Merge pull request #422 from strongloop/feature/fix-mongodb-issue-87
Remove undefined properties for create
2015-02-04 19:11:02 +01:00
Raymond Feng 78aca02651 Merge pull request #426 from strongloop/feature/fix-typo
Fix typo
2015-02-04 08:30:36 -08:00
Raymond Feng 79eabf3cf9 Fix typo 2015-02-04 08:30:13 -08:00
Miroslav Bajtoš 7a7fcb2e34 test: undefined property values are preserved 2015-02-04 09:08:28 +01:00
Miroslav Bajtoš 9b675ef3dc Merge pull request #421 from strongloop/feature/update-should
Update to `should` to the latest version 4.6.3
2015-02-03 19:38:39 +01:00
Raymond Feng 9769df2c91 Remove undefined properties for create
See https://github.com/strongloop/loopback-connector-mongodb/issues/87
2015-02-03 08:35:18 -08:00
Miroslav Bajtoš 3593127ef3 Update to `should` to the latest version 4.6.3 2015-02-03 11:44:15 +01:00
Andrey Loukhnov e68ecb461a Create model foreign key matching type of opposite part of relation (even if it has a custom field type) 2015-02-03 13:13:00 +03:00
Andrey Loukhnov ac547433b1 minor formatting issues (trailing spaces and such) and .editorconfig 2015-02-03 13:08:23 +03:00
Raymond Feng 1f0f4b0f02 Relax the id equality test for mongodb object ids 2015-02-02 10:51:41 -08:00
Miroslav Bajtoš 4304b9a32d Merge tag 'v2.15.0'
2.15.0

 * Fix id type issue for update (Raymond Feng)

 * Rename hook "query" to "access" (Miroslav Bajtoš)

 * Implement intent hook `before delete` (Miroslav Bajtoš)

 * Remove redundant `.toObject()` call from `upsert` (Miroslav Bajtoš)

 * Fix regression in `.save()` from 1fd6eff1 (Miroslav Bajtoš)

 * Fix hasOne remoting (Raymond Feng)

 * Make sure batch create calls back with correct data (Raymond Feng)

 * Intent-based hooks for persistence (Miroslav Bajtoš)

 * ModelBaseClass: implement async observe/notify (Miroslav Bajtoš)

 * Upgrade `should` to the latest 1.x version (Miroslav Bajtoš)

 * Fixed nullCheck in validations to correct behavior when dealing with undefined attributes (James Billingham)

 * Supply target to applyProperties function (Fabien Franzen)

 * fix id property for composite ids (Clark Wang)

 * fix id properties should sort by its index (Clark Wang)

 * Fixed typos and logic for protected properties (Christian Enevoldsen)

 * adds support for protected properties. (Christian Enevoldsen)

 * support embeds data for belongsTo relation Signed-off-by: Clark Wang <clark.wangs@gmail.com> (Clark Wang)
2015-02-02 19:10:45 +01:00
Miroslav Bajtoš cd0d76c6da Merge branch 'release/2.15.0' into production 2015-02-02 19:10:40 +01:00
Miroslav Bajtoš b169650618 v2.15.0 2015-02-02 19:10:36 +01:00
Miroslav Bajtoš 9298919ec0 Merge pull request #418 from strongloop/feature/rename-query-to-access-hook
Rename hook "query" to "access"
2015-02-02 19:04:47 +01:00
Raymond Feng 4793546353 Merge pull request #400 from chrene/protected
Add support for protected properties.
2015-02-02 09:04:51 -08:00
Raymond Feng bba1ce0768 Merge pull request #405 from clarkorz/fix/id-for-compositeIds
fix id property for composite ids
2015-02-02 08:59:40 -08:00
Raymond Feng fd97b06bcc Merge pull request #416 from strongloop/feature/fix-lb-1058
Fix id type issue for update
2015-02-02 08:58:10 -08:00
Raymond Feng 4afb2385a9 Fix id type issue for update
https://github.com/strongloop/loopback/issues/1058
2015-02-02 08:44:36 -08:00
Miroslav Bajtoš fcaf19a1d2 Rename hook "query" to "access"
The name "query" creates incorrect assumption that hook handlers
may return the result of a query to bypass database access.
That is far from true, since this hook is called also by methods
like `deleteAll` or `updateAll` that don't perform any SELECT query.
2015-02-02 10:41:18 +01:00
Miroslav Bajtoš d3d0570348 Merge pull request #412 from strongloop/feature/before-delete-hook
Implement intent hook `before delete`
2015-02-02 09:23:52 +01:00
Miroslav Bajtoš 370966df99 Implement intent hook `before delete`
Methods `DAO.deleteAll` and `DAO.prototype.delete` now invoke
`before delete` hook too. The hook receives `ctx.where` describing
models to be deleted.
2015-02-02 09:13:31 +01:00
Miroslav Bajtoš 842e543bf7 Merge pull request #415 from strongloop/fix/regression-in-dao-save
Fix regression in `.save()` from 1fd6eff
2015-01-30 18:28:10 +01:00
Raymond Feng e41b2d9393 Merge pull request #414 from strongloop/feature/fix-hasone-remoting
Fix hasOne remoting
2015-01-30 08:23:46 -08:00
Raymond Feng c1697d5b5a Merge pull request #413 from strongloop/feature/fix-lb-1031
Make sure batch create calls back with correct data
2015-01-30 08:23:32 -08:00
Miroslav Bajtoš 31b9da7d44 Remove redundant `.toObject()` call from `upsert` 2015-01-30 11:31:30 +01:00
Miroslav Bajtoš 5cfbfe3a19 Fix regression in `.save()` from 1fd6eff1
The commit 1fd6eff1 (intent-based hooks) introduced a subtle regression
in `.save()` method where dynamic property setters were invoked twice.

This commit fixes the problem by moving pre-save data normalization
into `before save` callback.
2015-01-30 11:31:12 +01:00
Raymond Feng e46bd0cdb5 Fix hasOne remoting 2015-01-29 23:26:11 -08:00
Raymond Feng 7d42202d40 Make sure batch create calls back with correct data
See https://github.com/strongloop/loopback/issues/1031
2015-01-29 11:52:39 -08:00
Miroslav Bajtoš ce39f8ab01 Merge pull request #403 from strongloop/feature/intent-hooks
Intent-based hooks for persistent models
2015-01-29 08:59:28 +01:00
Miroslav Bajtoš 1fd6eff10f Intent-based hooks for persistence
This patch introduces a new API for "intent-based" hooks. These hooks
are not tied to a particular method (e.g. "find" or "update"). Instead,
they are triggered from all methods that execute a particular "intent".

The consumer API is very simple, there is a new method
Model.observe(name, observer), where the observer is function
observer(context, callback).

Observers are inherited by child models and it is possible to register
multiple observers for the same hook.

List of hooks:

 - query
 - before save
 - after save
 - after delete
2015-01-29 08:43:52 +01:00
Miroslav Bajtoš b3d07ebbe8 ModelBaseClass: implement async observe/notify
Implement infrastructure for intent-based hooks.
2015-01-29 08:43:50 +01:00
Miroslav Bajtoš f9b0ac482c Upgrade `should` to the latest 1.x version 2015-01-29 08:41:19 +01:00
Raymond Feng 577def97f8 Merge pull request #409 from billinghamj/master
Fixed nullCheck in validations for undefined attributes
2015-01-27 14:20:53 -08:00
James Billingham 28f3f5d9f8 Fixed nullCheck in validations to correct behavior when dealing with undefined attributes 2015-01-27 22:18:47 +00:00
Raymond Feng 70833b2a2b Merge pull request #407 from fabien/fix/apply-props
Supply target to applyProperties function
2015-01-26 11:19:26 -08:00
Fabien Franzen a08ef823be Supply target to applyProperties function 2015-01-26 19:09:29 +01:00
Clark Wang 2e9e2dd192 fix id property for composite ids
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
2015-01-22 10:39:47 +08:00
Raymond Feng b2f41f4344 Merge pull request #402 from clarkorz/fix/ids-sort
fix id properties should sort by its index
2015-01-21 08:29:07 -08:00