Moved Rails plugins required by the core to lib/plugins.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9533 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
top_level:
|
||||
id: 1
|
||||
name: Top Level
|
||||
lft: 1
|
||||
rgt: 10
|
||||
child_1:
|
||||
id: 2
|
||||
name: Child 1
|
||||
parent_id: 1
|
||||
lft: 2
|
||||
rgt: 3
|
||||
child_2:
|
||||
id: 3
|
||||
name: Child 2
|
||||
parent_id: 1
|
||||
lft: 4
|
||||
rgt: 7
|
||||
child_2_1:
|
||||
id: 4
|
||||
name: Child 2.1
|
||||
parent_id: 3
|
||||
lft: 5
|
||||
rgt: 6
|
||||
child_3:
|
||||
id: 5
|
||||
name: Child 3
|
||||
parent_id: 1
|
||||
lft: 8
|
||||
rgt: 9
|
||||
top_level_2:
|
||||
id: 6
|
||||
name: Top Level 2
|
||||
lft: 11
|
||||
rgt: 12
|
||||
@@ -0,0 +1,15 @@
|
||||
class Category < ActiveRecord::Base
|
||||
acts_as_nested_set
|
||||
|
||||
def to_s
|
||||
name
|
||||
end
|
||||
|
||||
def recurse &block
|
||||
block.call self, lambda{
|
||||
self.children.each do |child|
|
||||
child.recurse &block
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
top:
|
||||
id: 1
|
||||
name: Top
|
||||
@@ -0,0 +1,38 @@
|
||||
scope1:
|
||||
id: 1
|
||||
body: Top Level
|
||||
lft: 1
|
||||
rgt: 10
|
||||
notable_id: 1
|
||||
notable_type: Category
|
||||
child_1:
|
||||
id: 2
|
||||
body: Child 1
|
||||
parent_id: 1
|
||||
lft: 2
|
||||
rgt: 3
|
||||
notable_id: 1
|
||||
notable_type: Category
|
||||
child_2:
|
||||
id: 3
|
||||
body: Child 2
|
||||
parent_id: 1
|
||||
lft: 4
|
||||
rgt: 7
|
||||
notable_id: 1
|
||||
notable_type: Category
|
||||
child_3:
|
||||
id: 4
|
||||
body: Child 3
|
||||
parent_id: 1
|
||||
lft: 8
|
||||
rgt: 9
|
||||
notable_id: 1
|
||||
notable_type: Category
|
||||
scope2:
|
||||
id: 5
|
||||
body: Top Level 2
|
||||
lft: 1
|
||||
rgt: 2
|
||||
notable_id: 1
|
||||
notable_type: Departments
|
||||
Reference in New Issue
Block a user