Commit Graph

1749 Commits

Author SHA1 Message Date
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
Fabien Franzen cd3ad32bb7 Fix formatting 2014-08-14 20:12:17 +02:00
Fabien Franzen 7d847f25dc Fix scopeMethods closure issue 2014-08-14 20:12:17 +02:00
Fabien Franzen a67759dcbf Refactored embedsMany (relationName vs. propertyName) 2014-08-14 20:12:16 +02:00
Fabien Franzen a243d05880 Enable DL definition of embedsMany + referencesMany 2014-08-14 20:12:16 +02:00
Miroslav Bajtoš 6ea6f19752 Merge pull request #209 from fabien/fix/refactor-modelto
Refactor modelTo
2014-08-14 20:00:24 +02:00
Fabien Franzen 807a6aaf3f Refactor modelTo logic into lookupModelTo 2014-08-14 19:43:30 +02:00
Miroslav Bajtoš 12514b01d0 Merge pull request #210 from fabien/fix/embeds-many
Tiny fix: use setAttributes
2014-08-14 18:55:00 +02:00
Fabien Franzen e6c9de02e2 Remove redundant test 2014-08-14 17:13:58 +02:00
Fabien Franzen f2025c3995 Allow partial list of ids for sortByIds 2014-08-14 09:40:03 +02:00
Fabien Franzen d7555bfb64 Allow runtime override of scope/relation order query param 2014-08-13 16:24:11 +02:00
Fabien Franzen 710ad35b39 Implement scope.defineMethod/relation.defineMethod 2014-08-13 11:28:23 +02:00
Fabien Franzen 29e4314ec0 Fix formatting 2014-08-13 10:10:34 +02:00
Jaka Hudoklin 0d44cdc573 add count to relations
Signed-off-by: Jaka Hudoklin <jakahudoklin@gmail.com>
2014-08-12 14:44:33 +02:00
Rand McKinney 4cb22793e2 Fix links to confluence docs 2014-08-11 11:42:21 -07:00
Fabien Franzen 3b398c5f77 Fix scopeMethods closure issue 2014-08-11 19:07:48 +02:00
Fabien Franzen dd9ea68f47 Refactored embedsMany (relationName vs. propertyName) 2014-08-11 15:33:41 +02:00
Fabien Franzen f2c349b5b3 Enable DL definition of embedsMany + referencesMany 2014-08-11 14:43:51 +02:00
Fabien Franzen 93fab448bc Tiny fix: use setAttributes 2014-08-11 13:03:51 +02:00
Fabien Franzen 5a18839053 Merge branch 'master' into fix/refactor-modelto 2014-08-10 17:21:35 +02:00
Fabien Franzen 1724f350de Refactor modelTo logic into lookupModelTo 2014-08-10 17:08:31 +02:00
Fabien Franzen d1466bffcb Cleanup mixin tests 2014-08-09 10:58:03 +02:00
Raymond Feng c3f7a7acb5 Merge tag 'v2.3.1'
2.3.1
2014-08-08 15:54:32 -07:00
Raymond Feng a848628db8 Merge branch 'release/2.3.1' into production 2014-08-08 15:54:23 -07:00
Raymond Feng c53dc74d16 Fix a name conflict in scope metadata 2014-08-08 15:52:30 -07:00
Raymond Feng a48d2fdfeb Merge tag 'v2.3.0'
2.3.0
2014-08-08 09:45:38 -07:00
Raymond Feng 82475b58af Merge branch 'release/2.3.0' into production 2014-08-08 09:45:32 -07:00
Raymond Feng 950be998bc Fix the test case so that it works with other DBs 2014-08-08 09:39:36 -07:00
Raymond Feng 366ff3bf62 Bump version 2014-08-08 09:30:16 -07:00
Raymond Feng caff62d8b3 Merge branch 'fabien-feature/plugins' 2014-08-08 09:29:17 -07:00
Raymond Feng 3d5ec63c99 Pass options into scope 2014-08-08 09:25:49 -07:00
Raymond Feng 7fe7bf9b9a Add scope definitions to the model class
See https://github.com/strongloop/loopback/issues/454
2014-08-08 09:01:24 -07:00
Raymond Feng f671c9c726 Clean up the mixin processing 2014-08-08 01:20:57 -07:00
Raymond Feng 55ff28206f Merge branch 'feature/plugins' of github.com:fabien/loopback-datasource-juggler into fabien-feature/plugins 2014-08-07 22:51:25 -07:00
Raymond Feng 0adf440cd1 Merge pull request #203 from lchenay/patch-5
Fix bug when using multiple include keys on related method
2014-08-07 17:01:46 -07:00
Raymond Feng 327f142a89 Merge tag 'v2.2.2'
2.2.2
2014-08-07 10:37:35 -07:00
Raymond Feng 695078df78 Merge branch 'release/2.2.2' into production 2014-08-07 10:37:29 -07:00
Raymond Feng 3efd758658 Bump version 2014-08-07 10:36:49 -07:00