activerecord-hierarchical_query: Error: undefined method `bound_attributes` for ActiveRecord::Relation
ruby 2.1.2, rails 3.2.14, gem version 1.0.0 When traversing descendants, i’ve got error from .rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-hierarchical_query-1.0.0/lib/active_record/hierarchical_query/cte/non_recursive_term.rb:18:in `bind_values’
def bind_values
scope.bound_attributes
end
I’ve looked into source here, at github, and have found that in master branch you have next lines in that file:
def bind_values
scope.bind_values
end
When i replaced the line in this local file, i’ve got similar error for file .rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-hierarchical_query-1.0.0/lib/active_record/hierarchical_query/cte/recursive_term.rb That error had been bypassed the same way and traversing started to work as expected. Help me, please, to use your very handful gem without that local files editings.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 23 (7 by maintainers)
Just a FYI, I moved Rails 5 to the master branch and deleted the other Rails 5 branches. I created a new branch for Rails 4 and I upgraded some of the dependancies there as well. It seems like there is an issue with Ruby 2.4 and up with Rails 4.1 and down, so I prioritized supporting Rails 4.2 and modern Ruby, since that’s the longterm supported version anyway.
Because I’m dropping support for Rails 3, I cut a new gem for 0.2.0 though other than dependancy updates, little has changed. I also tagged 1.1.0 and 0.2.0. This repo is now in a state that I’m happy with. If there are issues let me know.
Ok. I’ve got a fix and test ready I just need to clean up some things here and there. I’m modernizing all the gems as well, since I find keeping things current easier.
Since I’m taking over this project I’m going to be dropping support for Rails 4 and below. The Rails core team is doing some changes to how the Arel classes work and it won’t be possible for me to structure things agnostically without a level of effort that I don’t think it is worth.
But since this is my first real change to this repo I might not have my head fully around how everything fits together. So if @take-five agrees, I’m going to keep it on the rails-5 branch for now, though I’m bumping the version to 1.1.0 because the change.
I have to go offline until tomorrow, but should have the fix pushed in the next 24 hours.
I’m able to reproduce. Working on it now.