Project

General

Profile

How to order root issues?

Added by @ go2null over 9 years ago

I would like to order root issues relative to each other.

I can do the following for children nodes:

issue_a.move_to_right_of(issue_b)

However, the same code does not work for root issues, because they have different scopes (root_id).

# app/models/issue.rb
47:  acts_as_nested_set :scope => 'root_id', :dependent => :destroy

# lib/plugins/awesome_nested_set/lib/awesome_nested_set/model/movable.rb

9:          def move_possible?(target)
            self != target && # Can't target self
              same_scope?(target) && # can't be in different scopes
              # detect impossible move
              within_bounds?(target.left, target.left) &&
              within_bounds?(target.right, target.right)
          end

Any help would be appreciated.

Environment:
  Redmine version                2.6.0.stable
  Ruby version                   1.9.3-p484 (2013-11-22) [x86_64-linux]
  Rails version                  3.2.19
  Environment                    production
  Database adapter               Mysql2

Replies (1)

    (1-1/1)