Project

General

Profile

Actions

Defect #12460

closed

Project.rebuild_tree! fails

Added by Ken Zalewski almost 12 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Projects
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

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>'

Actions

Also available in: Atom PDF