-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support newer Rails versions #5
Comments
Hi @mklink. To be honest, I can't commit to being a good maintainer for Arboreal, as I haven't used it myself for for almost a decade, and seldom work with ActiveRecord these days. I think the most sensible course of action is a switch to Ancestry, which appears to be actively maintained. Alternatively, you could work with the mavenlink folks to get Arboreal into a better state - up-to-date and well-tested. If a group emerges that wishes to actively maintain Arboreal, I'd be happy to hand over the keys. |
Thank you for the heads up, @mdub. I decided to move to Ancestry. It was relatively easy. The most difficult parts were custom scopes based on matching Replacing Arboreal with Ancestry- acts_arboreal
+ has_ancestry The main difference is that Arboreal uses the def up
execute "UPDATE product_types SET ancestry = REPLACE(TRIM('-' FROM ancestry_string), '-', '/') WHERE ancestry_string LIKE '-%-'"
end Delimiter caveatAncestry doesn't use enclosing delimiters. This can trip you up if you use queries matching a part of NULL caveatThe scope :ordered_by_child_ancestry, -> {
- order("CONCAT(ancestry_string, id, '-')")
+ order("IFNULL(CONCAT(ancestry, '/', id), id)")
} Obsolete usagesMake sure you find all places that use methods or columns that don't exist any more. Rails 3 caveatAncestry still supports Rails 3 but I found one incompatibility: it uses the # Forward compatibility with Rails 4 which is needed by ancestry.
scope :none, -> {
where("false")
} |
Hi!
I'm in the process of upgrading an old Rails application from Rails 3.2. It depends on arboreal which doesn't support newer versions at the moment. I've seen #4 which contains a lot of good work to upgrade but needs splitting up.
I have three options:
Switching to that Arboreal fork would involve renaming a database column and incorporating changes that may not be well tested. If I have to change the database, I may as well switch to Ancestry. So really, I'm weighing up between switching to Ancestry and fixing up Arboreal's Rails compatibility myself.
What is your vision for this gem? Would you like to release new versions that are not compatible with old Ruby and old Rails? Do you see advantages of Arboreal over Ancestry? @mdub
The text was updated successfully, but these errors were encountered: