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

feat: add leoric_bone meta data to Bone #324

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

JimmyDaddy
Copy link
Collaborator

https://github.com/eggjs/egg-orm/blob/7086680f533b9efa70db55e06345adbb5ac321f5/lib/loader.js#L46

if (!(OriginModelClass && OriginModelClass.prototype && OriginModelClass.prototype instanceof Model)) {
  return OriginModelClass;
}
// => 
if (!(Realm.isLeoricBone(OriginModelClass)) {
  return OriginModelClass;
}

model class could be multiple inheritance, OriginModelClass.prototype instanceof Model cannot be a proper way to validate a model is a leoric bone

index.js Outdated
@@ -14,6 +14,7 @@ const Realm = require('./src/realm');
const Decorators = require('./src/decorators');
const Raw = require('./src/raw');
const { MysqlDriver, PostgresDriver, SqliteDriver, AbstractDriver } = require('./src/drivers');
const { isLeoricBone } = require('./src/utils');
Copy link
Owner

Choose a reason for hiding this comment

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

can we change this to isBone()? The Leoric part in the function name seems unnecessary.

Copy link
Owner

Choose a reason for hiding this comment

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

the rest looks good to me

@JimmyDaddy JimmyDaddy force-pushed the feat/add_leoric_bone_metadata branch from 80df604 to f7e8125 Compare July 20, 2022 14:41
@cyjake cyjake merged commit a3cd68d into master Jul 21, 2022
@cyjake cyjake deleted the feat/add_leoric_bone_metadata branch July 21, 2022 01:48
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

Successfully merging this pull request may close these issues.

2 participants