-
Notifications
You must be signed in to change notification settings - Fork 239
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
hash_tree not using STI scope on Rails 5 #220
Comments
I can add a bit more info to this. It is not just the STI scope that is affected - it is any scope.
Generates the same query above, ignoring the where condition. |
AFAIK closure tree and rails 5 hasn't been verified by anyone yet.
Given how much work had to be done from rails 3 to 4, it's not surprising
rails 5 has broken fairly basic assumptions made by this library as well.
The first step would be to add a gemfiles/activerecord-5.0.0rc1.gemfile and
see what's breaking.
The second step is to figure out what needs to change in the gem to make
rails 5 happy.
The third step is to figure out how to do that simultaneously with rails 4
to make both happy.
The fourth step is whiskey.
|
closure_tree is a core part of my project - https://github.com/pushtype/push_type - and I'm kind of optimistic not too much is broken in rails 5 (i may regret saying that :)) The only closure_tree related issues I've found is this one, and the issue fixed in #209. If you like I can try and help you with your first step (create a fork with a rails5 gemfile), so I can let you know the lay of the land. I'm not sure I'll be able to help too much with 2 & 3, but can definitely help you with 4! |
Any help is greatly appreciated! With RC1 out for a month already, the
final release is imminent.
|
I've created a rails-5 fork with new gemset: https://github.com/aaronrussell/closure_tree/tree/rails-5 All of your tests pass with activerecord 5. I'm not sure if that's good thing or a worrying thing 😟 . Next week I'll try and add a failing test for this specific issue. Hopefully though, this upgrade won't cause too many nightmares. |
NICE
|
Testing one of my apps for Rails 5, and have noticed
hash_tree
doesn't use the STI scope of the calling class. I can't pinpoint exactly where the issue is in the code, but can confirm the following SQL statements.When calling
Page.hash_tree
Rails 4.2
Rails 5
Notice that rails 5 does't include the
WHERE "nodes"."type" IN ('Page')
condition.The text was updated successfully, but these errors were encountered: