Skip to content

lb-ng sometimes changes methods from Model.updateAttributes to Model.prototype$updateAttributes #270

Description

@jdforsythe

Bug or Feature

  • Bug
  • Feature request

Description of feature (or steps to reproduce if bug)

Since the beginning of the project I'm working on, lb-ng generates the update methods as static updateAttributes() methods on the models, e.g. Model.updateAttributes(). At some point a couple weeks ago, running lb-ng changed all those methods to be Model.prototype$updateAttributes(). I assumed I had inadvertently updated the SDK, so I changed all my update calls to the new prototype$ and everything was working fine. Now I added another remote method to a model and regenerated. They have all switched back to the initial Model.updateAttributes().

All models were changed in the generated lb-services.js, not just the one with the remote method added. Nothing else in the model definitions has changed since the last generation.

Link to sample repo to reproduce issue (if bug)

Expected result

The method names shouldn't change when regenerating the services file

Actual result (if bug)

Additional information (Node.js version, LoopBack version, etc)

Using Node 6.9.4, Loopback 3.4.0

Example diff from previous run (it changed every model like this, and added the one remote method):

diff --git a/client/services/lb-services.js b/client/services/lb-services.js
index 2840b77..88d8e89 100644
--- a/client/services/lb-services.js
+++ b/client/services/lb-services.js
@@ -20141,7 +20141,7 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' &&
 
             /**
              * @ngdoc method
-             * @name lbServices.Post#prototype$updateAttributes
+             * @name lbServices.Post#updateAttributes
              * @methodOf lbServices.Post
              *
              * @description
@@ -20173,7 +20173,7 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' &&
              * This usually means the response is a `Post` object.)
              * </em>
              */
-        R["prototype$updateAttributes"] = R["prototype$patchAttributes"];
+        R["updateAttributes"] = R["prototype$patchAttributes"];

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions