-
Notifications
You must be signed in to change notification settings - Fork 465
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
Fix materialized_path2 #597
Conversation
0cc6b6d
to
8a46ea1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is great.
I do have the goal of going away from all these cattr_accessor
values. To be honest, this sounds minor but it has been my main sticking point. It is the reason I am dragging my feet.
Rails has helper methods that mixed into the class that take parameters. And then dynamically creates methods with the special variable (e.g.: delimiter, ancestry_column) passed in as a parameter.
We, on the other hand, mix in a class that access the special variable via cattr.
If we go towards this other behavior, then we can have multiple ancestry columns per record and I believe it would actually simplify our code.
Is there a way to change this code so we are not introducing yet more cattrs?
@kbrock these parameters were previously hard-coded, which is definitely not good. Now they are used both in other modules (like the It probably makes sense to change them to |
@kbrock here's a take on |
@kbrock how about releasing 4.3 on RubyGems? :) |
@kbrock 4.2 is still the latest version on RubyGems, do you have access to release a new version? |
* Fix: descendants ancestry is now updated in after_update callbacks stefankroes#589 * Document updated grammar stefankroes#594 * Documented `update_strategy` stefankroes#588 * Fix: fixed has_parent? when non-default primary id stefankroes#585 * Documented column collation and testing stefankroes#601 stefankroes#607 * Added initializer with default_ancestry_format stefankroes#612 * ruby 3.2 support stefankroes#596
* Fix: materialized_path2 strategy stefankroes#597 * Fix: descendants ancestry is now updated in after_update callbacks stefankroes#589 * Document updated grammar stefankroes#594 * Documented `update_strategy` stefankroes#588 * Fix: fixed has_parent? when non-default primary id stefankroes#585 * Documented column collation and testing stefankroes#601 stefankroes#607 * Added initializer with default_ancestry_format stefankroes#612 * ruby 3.2 support stefankroes#596
* Fix: materialized_path2 strategy stefankroes#597 * Fix: descendants ancestry is now updated in after_update callbacks stefankroes#589 * Document updated grammar stefankroes#594 * Documented `update_strategy` stefankroes#588 * Fix: fixed has_parent? when non-default primary id stefankroes#585 * Documented column collation and testing stefankroes#601 stefankroes#607 * Added initializer with default_ancestry_format stefankroes#612 * ruby 3.2 support stefankroes#596
materialized_path2 was completely broken from the beginning.
This PR fixes it and renames
strategy
toancestry_format
since it's not really a strategy, it doesn't change any behavior.