Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model.toMap should include superClass properties #117

Open
1 of 2 tasks
nikooiko opened this issue Apr 14, 2017 · 0 comments
Open
1 of 2 tasks

Model.toMap should include superClass properties #117

nikooiko opened this issue Apr 14, 2017 · 0 comments

Comments

@nikooiko
Copy link

nikooiko commented Apr 14, 2017

Bug or feature request

  • Bug
  • Feature request

Description of feature (or steps to reproduce if bug)

Here is the actual call stack
Model.toMap() > VirtualObject.toMap() > BeanUtil.getProperties(model, false, false);

BeanUtil.getProperties is called with hardcoded false (second param) that doesn't allow the model to include it's parent's properties.

I think that there should be a way to include model's parent properties when calling toMap(). For example if we define a model AppUser that extends User, appUser.save() (that internally calls Model.toMap) should include password property, defined at User class.

Current work around is to redefine the getters for the properties we want to include.

Link to sample repo to reproduce issue (if bug)

Expected result

If a model extends another model (eg AppUser that extends User) should probably include it's parents properties.

Actual result (if bug)

Only the model's properties.

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

LB Android SDK: 1.5.1

@nikooiko nikooiko changed the title Model.toMap doesn't include superClass properties Model.toMap should include superClass properties Apr 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant