Commit Graph

79 Commits

Author SHA1 Message Date
Raymond Feng c609b6d7ce Allow leading slash for `path` in model settings 2015-04-24 08:23:13 -07:00
Miroslav Bajtoš 99d4c6aa8d Add new strict mode "validate"
When a model is configured with `strict: 'validate'`,
any dynamic properties not included in the schema trigger
a validation error.
2015-04-14 08:16:10 +02:00
Raymond Feng 33d3239b44 Allow submodel to hide base properties 2015-03-03 10:27:22 -08:00
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
Miroslav Bajtoš 3593127ef3 Update to `should` to the latest version 4.6.3 2015-02-03 11:44:15 +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
Fabien Franzen 610866bd7c Extract mergeQuery and setScopeValuesFromWhere
Related to #274 - in preparation of default scope
2014-10-09 18:13:40 +02:00
Raymond Feng fe74c8019c Tidy up model building from data sources
See https://github.com/strongloop/loopback/issues/560
2014-09-12 14:25:35 -07:00
Clark Wang 4b70f2498f Fix options for hasManyThrough doesn't apply
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
2014-09-01 23:59:52 +08:00
Raymond Feng fde5b426e4 Make sure error events are emitted by data source 2014-08-27 09:14:17 -07:00
Raymond Feng fcd8ed984c Make sure falsy value is kept for properties not predefined 2014-08-21 13:47:09 -07:00
Fabien Franzen ad780604e1 Properly handle LDL for polymorphic relations 2014-08-16 11:03:16 +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
Raymond Feng d07b716ae8 Merge pull request #200 from strongloop/feature/emit-events-during-attach
Emit dataAccessConfigured events during attach
2014-08-04 15:27:11 -07:00
Fabien Franzen 93aea7eb66 Changed options.path to option.http.path 2014-08-04 19:45:47 +02:00
Fabien Franzen 81a822524d Removed normalization (see strong-remoting) 2014-08-04 12:17:06 +02:00
Raymond Feng b9d9ab0fb3 Emit dataAccessConfigured events during attach
See discussions at https://github.com/strongloop/loopback/issues/410
2014-08-01 08:22:33 -07:00
Fabien Franzen 71bf0f8240 Customize/Normalize class-level remoting http path 2014-08-01 09:38:25 +02:00
Raymond Feng 8f46626c0b Expose base model class as `base` property 2014-07-21 10:21:30 -07:00
Raymond Feng fc710ca55a Merge branch 'master' into 2.0 2014-07-15 17:09:20 -07:00
Raymond Feng a37129bdff Allows default model class to be configured 2014-07-08 14:04:20 -07:00
Raymond Feng ce8254125f Merge branch 'master' into 2.0 2014-06-21 12:53:46 -07:00
Raymond Feng 3edee5c4c5 Work around for Date default
See https://github.com/strongloop/loopback-connector-postgresql/issues/15
2014-06-21 12:53:06 -07:00
Raymond Feng 44de2da21f Merge branch 'master' into 2.0 2014-06-20 23:02:37 -07:00
Raymond Feng 3f7e85101d Merge pull request #140 from strongloop/feature/refactor-relation
Feature/refactor relation
2014-06-20 20:56:44 -07:00
Raymond Feng 7c71e1e53b Merge pull request #141 from strongloop/feature/fix-perf
Feature/fix perf
2014-06-18 22:40:00 -07:00
Raymond Feng 888d15ce1c Optimize model instantiation and conversion 2014-06-18 22:13:52 -07:00
Raymond Feng 4b9d98c6ce Allows skip or offset
See https://github.com/strongloop/loopback/issues/336
2014-06-17 09:07:55 -07:00
Raymond Feng 1406c22a64 Refactor relation into classes 2014-06-15 15:53:58 -07:00
Raymond Feng 5f3c856d2e Fix the logical operator check 2014-06-04 14:23:53 -07:00
Raymond Feng 42c1ad3dca Normalize/validate the query filter object 2014-06-02 15:57:44 -07:00
Raymond Feng 97b1501c1f Keep undefined/null values for the array type
This allows connectors to distinguish between empty array and
undefined/null. For example, mongodb will not override existing array
properties if the value is undefined.
2014-05-27 21:59:21 -07:00
Raymond Feng 050353f11d Keep undefined/null values for the array type
This allows connectors to distinguish between empty array and
undefined/null. For example, mongodb will not override existing array
properties if the value is undefined.
2014-05-27 13:18:21 -07:00
Ritchie Martori dc9c9b2bd4 Remove remoting metadata 2014-05-16 12:33:17 -07:00
Raymond Feng 3f410cae21 Add test cases for updateOrCreate/save and fix related issues 2014-05-09 15:27:45 -07:00
Raymond Feng 1dc0c34252 Fix the connector resolver to make sure known connectors are used 2014-03-17 08:32:37 -07:00
Raymond Feng 24c4381221 Allows scopes to be defined in LDL 2014-03-03 17:16:37 -08:00
Raymond Feng 44a62d01af Allows unknown properties to be saved for non-strict models
See https://github.com/strongloop/loopback/issues/199
2014-02-24 18:38:45 -08:00
Raymond Feng 22eef6a33d Add a test case 2014-02-10 22:46:25 -08:00
Raymond Feng 1961fbeefe Enhance the assertions 2014-02-03 20:52:01 -08:00
Raymond Feng ee5b351398 Make sure own properties are copied by toObject for non-strict mode
See https://github.com/strongloop/loopback/issues/162
2014-01-30 11:51:34 -08:00
Raymond Feng da571c0c23 Use String[] for types and add test for supported types 2014-01-29 17:19:07 -08:00
Raymond Feng cf200a2e27 Add getType/getDefaultIdType from connectors 2014-01-29 17:19:07 -08:00
Raymond Feng 2b8c1ebaee Reformat the code 2014-01-24 09:09:53 -08:00
Raymond Feng c374cc89cd Use the primary key type for the generated foreign key 2014-01-21 09:47:32 -08:00
Raymond Feng 2a50388894 Make the code testable following the review comments 2014-01-13 11:06:02 -08:00
Raymond Feng acd02bf482 Allows the full module name for connectors 2014-01-09 17:03:37 -08:00
Raymond Feng c9e133d7bc Add a EOL 2013-12-18 17:14:54 -08:00
Raymond Feng e1ec152c78 Add models to LDL options
1. Use 'models' to specify the dependencies to other models
2. The 'models' property is an object, such as:

{
    Model1: 'Model1',
    Model2: Model2
}

3. The model classes will be injected into the newly defined class as
static properties using the keys from the models option.
2013-12-18 16:13:41 -08:00