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

Correctly propagate public name to the database #1078

Merged
merged 3 commits into from
Jan 5, 2023
Merged

Correctly propagate public name to the database #1078

merged 3 commits into from
Jan 5, 2023

Conversation

nirinchev
Copy link
Member

Fixes #697

@coveralls
Copy link

coveralls commented Dec 21, 2022

Pull Request Test Coverage Report for Build 3847004550

  • 6 of 6 (100.0%) changed or added relevant lines in 4 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 89.195%

Files with Coverage Reduction New Missed Lines %
generator/lib/src/pseudo_type.dart 2 42.11%
Totals Coverage Status
Change from base Build 3749518777: -0.02%
Covered Lines: 2815
Relevant Lines: 3156

💛 - Coveralls

@@ -49,6 +49,9 @@ class SchemaProperty {
/// Indicates that the property should be persisted under a different name
final String? mapTo;

/// @nodoc
String get internalName => mapTo ?? name;
Copy link
Contributor

@blagoev blagoev Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's introducing the problem which one should we use and when. Why not make name a getter which returns mapTo instead of name value?

String get name => mapTo ?? _name;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe we do need to differentiate in certain cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need the public name when setting up the Core schema.

@nirinchev nirinchev requested a review from blagoev January 5, 2023 14:16
@nirinchev
Copy link
Member Author

Those test failures seem unrelated to these changes.

@nirinchev nirinchev merged commit 96da6ee into main Jan 5, 2023
@nirinchev nirinchev deleted the ni/mapto branch January 5, 2023 22:55
@dotjon0
Copy link

dotjon0 commented Jan 5, 2023

Thanks so much @nielsenko

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assign the correct public name value while creating schema
6 participants