Defect #12460
closedProject.rebuild_tree! fails
0%
Description
In version 2.1.4, sorting projects by name was fixed. I confirmed this by running:
ruby script/rails runner 'Project.update_all(:lft=>nil,:rgt=>nil); Project.rebuild!'
Out of the box, projects were sorted properly without me having to patch the awesome_nested_set code.
However, a new method was added called 'Project.rebuild_tree!' to make it easier to rebuild the project list. This method is supposed to clear the lefts and rights, then rebuild.
This new method is failing.
Running:
ruby script/rails runner 'Project.rebuild_tree!'
produces the following errors:
/usr/lib64/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require': iconv will be deprecated in the future, use String#encode instead.
/usr/lib64/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands/runner.rb:53:in `eval': undefined method `rebuild_tree!' for #<Class:0x000000024842f0> (NoMethodError)
from (eval):1:in `<top (required)>'
from /usr/lib64/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands/runner.rb:53:in `eval'
from /usr/lib64/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands/runner.rb:53:in `<top (required)>'
from /usr/lib64/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:64:in `require'
from /usr/lib64/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:64:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'