Commit Graph

1536 Commits

Author SHA1 Message Date
Raymond Feng 5dc7a6350c Merge tag 'v2.4.2'
2.4.2
2014-08-18 20:38:31 -07:00
Raymond Feng b49915f042 Merge branch 'release/2.4.2' into production 2014-08-18 20:38:15 -07:00
Raymond Feng b47197e854 Bump version 2014-08-18 20:36:45 -07:00
Raymond Feng e1a516be75 Merge pull request #228 from fabien/fix/list-to-object
Prevent failure with null in List toObject
2014-08-17 22:34:09 -07:00
Fabien Franzen dad8266837 Prevent failure with null in List toObject 2014-08-18 07:28:33 +02:00
Raymond Feng a6fe10e527 Merge pull request #226 from fabien/feature/multi-mixin
Add ability to apply a plugin multiple times from LDL
2014-08-17 22:18:05 -07:00
Raymond Feng 38431753a1 Merge pull request #227 from fabien/fix/definition-tojson
Fix ModelDefinition toJSON bug
2014-08-17 22:17:05 -07:00
Fabien Franzen 291e7b2c74 Fix ModelDefinition toJSON bug 2014-08-17 18:01:52 +02:00
Fabien Franzen 39a728be84 Add ability to apply a plugin multiple times from LDL 2014-08-17 12:29:04 +02:00
Raymond Feng c3c2907248 Merge pull request #224 from fabien/fix/ldl-polymorphic
Properly handle LDL for polymorphic relations
2014-08-16 08:15:09 -07:00
Raymond Feng 9777639cb4 Merge pull request #225 from fabien/fix/has-many-exists
HasMany exists should use internal findById
2014-08-16 08:11:49 -07:00
Fabien Franzen b4b1c784dd HasMany exists should use internal findById
This limits the scope correctly, taking polymorphics into account.

(the foreign key check is actually obsolete I think)
2014-08-16 13:04:13 +02:00
Fabien Franzen 315d5c15c6 Tiny fix: obsolete i8n require 2014-08-16 11:07:48 +02:00
Fabien Franzen f5ec317800 Merge branch 'fix/ldl-polymorphic' of github.com:fabien/loopback-datasource-juggler into fix/ldl-polymorphic 2014-08-16 11:05:55 +02:00
Fabien Franzen ad780604e1 Properly handle LDL for polymorphic relations 2014-08-16 11:03:16 +02:00
Fabien Franzen a9f2da294c Properly handle LDL for polymorphic relations 2014-08-16 10:23:32 +02:00
Raymond Feng 855270d14a Merge tag 'v2.4.1'
2.4.1
2014-08-15 23:34:54 -07:00
Raymond Feng 3d0cf05e70 Merge branch 'release/2.4.1' into production 2014-08-15 23:34:48 -07:00
Raymond Feng 4df1f52c47 Bump version 2014-08-15 23:31:19 -07:00
Raymond Feng 7f9108c6d2 Check null
See https://github.com/strongloop/loopback-datasource-juggler/issues/223
2014-08-15 23:30:23 -07:00
Raymond Feng e23c2f2763 Merge tag 'v2.4.0'
2.4.0
2014-08-15 13:49:58 -07:00
Raymond Feng 50007e14ec Merge branch 'release/2.4.0' into production 2014-08-15 13:49:50 -07:00
Raymond Feng 5baf05c237 Bump version 2014-08-15 13:49:09 -07:00
Raymond Feng f37941dfd6 Fix the test cases to avoid hard-coded ids 2014-08-15 13:48:38 -07:00
Raymond Feng 572dac06cb Merge pull request #216 from fabien/fix/sorty-by-id
Allow partial list of ids for sortByIds
2014-08-15 13:05:24 -07:00
Fabien Franzen 3e300c1f35 Add strict flag to sortObjectsByIds
When true, any object not in the ids will be discarded and a subset
will be returned.
2014-08-15 19:47:12 +02:00
Fabien Franzen 2c40319585 Fix conflicts 2014-08-15 19:43:07 +02:00
Fabien Franzen 9f1c5d9c37 Moved DataAccessObject.sortByIds to utils.js 2014-08-15 19:39:58 +02:00
Fabien Franzen c599de42cd Remove redundant test 2014-08-15 19:39:58 +02:00
Fabien Franzen 085bb94505 Allow partial list of ids for sortByIds 2014-08-15 19:39:58 +02:00
Raymond Feng 8743d75999 Merge pull request #222 from fabien/fix/relation-tests
Fixed duplicate code
2014-08-15 10:15:11 -07:00
Fabien Franzen 0e348b0333 Fixed duplicate code 2014-08-15 18:51:19 +02:00
Raymond Feng 03d94a86e5 Merge pull request #219 from fabien/fix/relation-tests
Fix  BelongsTo.prototype.create + remaining issues with new relation types
2014-08-15 09:46:27 -07:00
Fabien Franzen 6b0bbed780 Merge branch 'fix/relation-tests' of https://github.com/fabien/loopback-datasource-juggler into fix/relation-tests 2014-08-15 18:43:20 +02:00
Fabien Franzen 94310549cf Implement embedded.destroy() integration 2014-08-15 18:41:06 +02:00
Fabien Franzen 96a276a12b Refactor embedsMany - auto-save parent
With this change, saving an embedded model now correctly updates the
parent model.

Before, a separate `save()` call on the parent was required, contrary
to other relation types.
2014-08-15 18:40:33 +02:00
Raymond Feng 62db2155e4 Merge pull request #212 from offlinehacker/relations_count
add count to relations
2014-08-15 09:37:50 -07:00
Fabien Franzen 8193f402bb Refactor polymorphic relations, fix inverse #215
See #215 - when creating a related item through a the inverse of a
polymorphic HABTM relation,
the through-model was not created correctly. By refactoring the
specifics into the `polymorphic`
property of a RelationDefinition, it's now possible to handle this
correctly.
2014-08-15 18:35:31 +02:00
Fabien Franzen 78e2c9c9d4 Clarified tests, fixed BelongsTo.prototype.create
Added clarified test-case based on previous documentation example.

Fixed BelongsTo.prototype.create - although the foreignKey was set on
the model instance,
it was never actually persisted, unless you'd issue a separate call to
save the 'parent' model.
2014-08-15 18:35:31 +02:00
Raymond Feng d7900a8a21 Merge pull request #211 from fabien/fix/relationTypes
Fix relationTypes
2014-08-15 09:29:22 -07:00
Raymond Feng e22389967c Merge pull request #214 from fabien/fix/scope-order
Allow runtime override of scope/relation order query param
2014-08-15 09:25:17 -07:00
Raymond Feng da4482d1cf Merge pull request #213 from fabien/feature/scope-rel-methods
Implement scope.defineMethod/relation.defineMethod
2014-08-15 09:24:24 -07:00
Raymond Feng 6cd2cbc99a Merge pull request #205 from fabien/feature/plugins
Cleanup mixin tests
2014-08-15 09:22:49 -07:00
Raymond Feng 97306037e3 Merge pull request #221 from fabien/fix/updateAttributes
Handle toObject in updateAttributes
2014-08-15 09:10:21 -07:00
Fabien Franzen 7cd880712b Handle toObject in updateAttributes
Since one can call updateAttributes with any kind of properties (as
opposed to save, which uses toObject internally), any objects that
correspond to toObject should be handled as such. This is particularly
the case with List objects, as used by embedsMany.
2014-08-15 18:01:40 +02:00
Fabien Franzen c2f9ee381c Implement embedded.destroy() integration 2014-08-15 15:24:00 +02:00
Fabien Franzen 21801058c9 Refactor embedsMany - auto-save parent
With this change, saving an embedded model now correctly updates the
parent model.

Before, a separate `save()` call on the parent was required, contrary
to other relation types.
2014-08-15 15:12:02 +02:00
Fabien Franzen c3c2c85ce4 Refactor polymorphic relations, fix inverse #215
See #215 - when creating a related item through a the inverse of a
polymorphic HABTM relation,
the through-model was not created correctly. By refactoring the
specifics into the `polymorphic`
property of a RelationDefinition, it's now possible to handle this
correctly.
2014-08-15 12:55:10 +02:00
Fabien Franzen 35850f6632 Clarified tests, fixed BelongsTo.prototype.create
Added clarified test-case based on previous documentation example.

Fixed BelongsTo.prototype.create - although the foreignKey was set on
the model instance,
it was never actually persisted, unless you'd issue a separate call to
save the 'parent' model.
2014-08-15 11:28:25 +02:00
Fabien Franzen 89e0566467 Fix conflicts 2014-08-14 20:18:08 +02:00