-
Notifications
You must be signed in to change notification settings - Fork 275
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 Inheritance #763
Comments
This is definitely due to the code I introduced to tweak what Brian added earlier. You take a small performance hit when you mix declared properties and association names, so my PR tried to identify nodes that are not doing this to limit its impact. It needs to initialize the variable when inherited. Lemme see if I can do this quickly but if not, I can take care of it in the morning. |
Will merge in the morning if all passes. |
Cool 😄 So for best performance would you recommend not mixing properties and associations? Something like:
|
Yes, definitely. When you mix associations and node properties, not only do you take a performance hit when it splits the one params hash into separate hashes, but it uses the None of this is really a problem in isolation but if speed is a concern, like when you're seeding a database, it can be a big issue. It also just adds up if you have other things happening within your app or database. |
associations_keys should inherit, fixes #763
This is merged in, fixed now. Made me realize there are probably a few other bugs related to inheritance that I'm going to check now. |
Working on this end 👍 thanks for the tip, btw! I'll keep poking around, see if I find anything |
@subvertallchris: Came across another potential inheritance bug:
Adding a person to a school via a form:
correctly adds the selected schools to UPDATE |
Could you message me in the Gitter room? I have so many questions. gitter.im/neo4jrb/neo4j |
A School model inherits from Community, and communities can be part_of other communities:
The below code only creates the relationship correctly if school.rb explicitly includes
has_many :out, :part_of, model_class: Community
like this:
The text was updated successfully, but these errors were encountered: