Commit Graph

2686 Commits

Author SHA1 Message Date
mdartic 7c22db6ea7 Filtering relations of a model with an order specified 2015-10-16 18:21:04 +02:00
Wert_Lex 1cab0164c2 home-written map extended with proper .set() method 2015-10-10 21:00:00 +05:00
Wert_Lex a5dd9c181a on the halfway to keeping original keys 2015-10-10 19:37:39 +05:00
Wert_Lex 0864bf7154 with updated map which stores original key and tests for them 2015-10-10 19:21:06 +05:00
Miroslav Bajtoš a2ed2a401b 2.41.0
* Ability to define normalization of undefined query (Ryan Schumacher)
 * findByIds would fail when an array of 0 length was passed as its first argument (James Cooke)
 * Use strongloop conventions for licensing (Sam Roberts)
2015-10-07 13:01:13 -07:00
Miroslav Bajtoš 98fb3c6832 Merge pull request #725 from jrschumacher/feature-normalize-undefined-in-query
Ability to define normalization of undefined query

Close #725
2015-10-07 09:27:51 -07:00
Ryan Schumacher 94c3f9a432 Ability to define normalization of undefined query
Add datasource and model setting `normalizeUndefinedInQuery`
to determine how it will handle undefined values. Options:

- nullify : converts undefined to null
- throw : throw an error on undefined value
- ignore : strip the key where undefined value is found

The default operation is to strip the key.
2015-10-07 09:26:09 -07:00
Simon Ho 934786200b Merge pull request #721 from cookejames/master
findByIds would fail when an array of 0 length was passed as its first argument
2015-09-23 09:22:49 -07:00
James Cooke 6dac956cf8 findByIds would fail when an array of 0 length was passed as its first argument 2015-09-23 16:27:41 +01:00
Sam Roberts 4b16e3b0bd Use strongloop conventions for licensing 2015-09-21 16:42:54 -07:00
Raymond Feng 7ede276e44 2.40.1
* Fix the test so that it works across DBs (Raymond Feng)
2015-09-11 11:15:39 -07:00
Raymond Feng 1e035c657e Fix the test so that it works across DBs 2015-09-11 11:15:00 -07:00
Raymond Feng 567ffb8040 2.40.0
* Fix id comparision in tests so that they work with mongodb object id (Raymond Feng)

 * Update validations.js (Rand McKinney)

 * Add support for using UUID V4 as defaultFn (Bram Borggreve)

 * primaryKey for hasMany and belongsTo relations (sklyukin)

 * primaryKey to hasOne relation (sklyukin)

 * Add direct copmarison value for array matching (Laurent Villeneuve)

 * Add support for matching array values à la mongo. (Laurent Villeneuve)

 * Fixed ReferencesMany .findById to check the given id in the ids array of the model instance (Satyadeep)
2015-09-10 13:43:58 -07:00
Raymond Feng a6519bb2ca Fix id comparision in tests so that they work with mongodb object id 2015-09-08 09:53:02 -07:00
Raymond Feng 207edd5eec Merge pull request #687 from sklyukin/master
primaryKey to hasOne relation
2015-09-08 09:20:42 -07:00
Rand McKinney 0e2d2c162e Update validations.js
Fix small mistake in doc comment.
2015-09-04 16:31:54 -07:00
nennad e679deb376 typo fix 2015-09-03 17:02:21 +01:00
nennad f3b0cb062e Fix foreignKey length issue
If the PK has a definition like
```
      "mysql": {
        "dataType": "CHAR",
        "dataLength":36,
        "nullable":"N"
      }
```

dataLength is ignored when the PK is used as a foreignKey in other models
2015-09-03 17:00:38 +01:00
Raymond Feng c4de830bfe Merge pull request #713 from beeman/add-defaultfn-uuidv4
Add support for using UUID V4 as defaultFn
2015-09-02 10:20:29 -07:00
Bram Borggreve fb11c78be0 Add support for using UUID V4 as defaultFn 2015-09-02 16:39:00 +02:00
sklyukin d0f9b760f5 primaryKey for hasMany and belongsTo relations 2015-09-01 19:03:02 +05:00
sklyukin 483cd873e7 primaryKey to hasOne relation 2015-09-01 01:31:28 +05:00
Raymond Feng febfe2362a Merge pull request #699 from satyadeepk/master
Fixed ReferencesMany .findById to check the given id in the modelInstance[fk]
2015-08-31 10:08:38 -07:00
Raymond Feng e91b5cfa9c Merge pull request #710 from WyzeLink/feature/support-implicit-array-matching
Add support for matching array values à la mongo.
2015-08-31 09:14:15 -07:00
Laurent Villeneuve cb78c8ef96 Add direct copmarison value for array matching 2015-08-27 23:56:49 -04:00
Laurent Villeneuve 632898b022 Add support for matching array values à la mongo. 2015-08-27 23:32:53 -04:00
Raymond Feng 0b22e2a2fb 2.39.0
* Optimze automigrate() to cut the test time signicantly (Raymond Feng)

 * Fix primary key checks (Simon Ho)

 * travis: drop 0.6 and 0.8, add iojs (Miroslav Bajtoš)

 * Upgrade Travis to container-based infrastructure (Miroslav Bajtoš)

 * Relax id requirement for basic query operations (Simon Ho)
2015-08-27 16:02:08 -07:00
Raymond Feng 236dda736c Merge pull request #709 from strongloop/feature/optimize-tests
Optimze automigrate() to cut the test time signicantly
2015-08-27 16:01:06 -07:00
Raymond Feng 682f6340d3 Optimze automigrate() to cut the test time signicantly 2015-08-27 15:59:58 -07:00
Simon Ho e2df36c006 Merge pull request #707 from strongloop/fix-primary-key-checks
Fix primary key checks
2015-08-27 14:51:17 -07:00
Simon Ho 57a9c40e16 Fix primary key checks 2015-08-27 13:59:43 -07:00
Simon Ho 4c92e15442 Merge pull request #689 from strongloop/relax-id-requirement
Relax id requirement for basic query operations
2015-08-25 10:02:29 -07:00
Wert_Lex 7b497eb58f Moved inst initialization to place where it used 2015-08-25 15:46:50 +03:00
Wert_Lex 84dc39dfe2 All tests passed 2015-08-24 20:45:41 +03:00
Miroslav Bajtoš 0a9e3beb55 Merge pull request #703 from strongloop/fix/travis-config
Upgrade Travis to container-based infrastructure
2015-08-24 15:56:47 +02:00
Miroslav Bajtoš 605e6f485e travis: drop 0.6 and 0.8, add iojs 2015-08-24 15:54:49 +02:00
Miroslav Bajtoš 85db71fd4f Upgrade Travis to container-based infrastructure
See http://docs.travis-ci.com/user/migrating-from-legacy/ for details.
2015-08-24 15:49:53 +02:00
Wert_Lex fb56915371 Dirty merge. Tests are broken 2015-08-24 16:07:43 +03:00
Wert_Lex e585021586 include utils add. Tests ported to should.js 2015-08-24 15:41:04 +03:00
Simon Ho cd71a37bfa Relax id requirement for basic query operations 2015-08-20 02:57:53 -07:00
Satyadeep ad83c82ebc Fixed ReferencesMany .findById to check the given id in the ids array of the model instance 2015-08-19 22:34:16 +05:30
Raymond Feng 347926ea13 2.38.0
* Support embedded query in memory connector. Fix memory connector bug (Laurent Villeneuve)

 * Use idEquals when comparing ids in relation definitions (Laurent Villeneuve)

 * Handle possible undefined id (Laurent Villeneuve)

 * Fix id copmarison by using strings (Laurent Villeneuve)

 * Refactor idEquals to utils (Raymond Feng)
2015-08-18 14:40:51 -07:00
Raymond Feng 75751eb7e6 Merge pull request #697 from WyzeLink/feature/support-embedded-query-in-memory
Support embedded query in memory connector. Fix memory connector bug
2015-08-18 14:39:55 -07:00
Laurent Villeneuve 0381f6d7e7 Support embedded query in memory connector. Fix memory connector bug
Adds support for the ability to query embedsMany models from the parent.

Fix a memory connector bug that could occur when having an "or" or "and"
clause combined with another property. In that case, the and would revert
true for 'Paul McCartney'

```
{name:'John Lennon',and: [{role:'lead'}, {vip:true}]}}
```
2015-08-18 15:56:36 -04:00
Raymond Feng 311c7fc07c Merge pull request #696 from WyzeLink/fix/embedded-relations-id-comparison
Fix id comparison by using strings
2015-08-18 08:56:35 -07:00
Laurent Villeneuve bdf703fb45 Use idEquals when comparing ids in relation definitions 2015-08-18 10:22:36 -04:00
Laurent Villeneuve 94ff275bbc Handle possible undefined id 2015-08-18 09:40:52 -04:00
Laurent Villeneuve 9363354e0f Fix id copmarison by using strings 2015-08-18 09:40:52 -04:00
Raymond Feng f5270c39c5 Refactor idEquals to utils 2015-08-17 12:49:38 -07:00
Raymond Feng 84c4d0e922 2.37.0
* Do not coerce RegExp objects to strings (Simon Ho)

 * Indicate result of destroyById/protototype.destroy (Fabien Franzen)

 * Removed extra ")" (Chris Finn)

 * Fixed typo & added the filter units (Chris Finn)
2015-08-14 09:32:18 -07:00