Lots going on
[lyrix.git] / vendor / rails / activerecord / test / fixtures / mixins.yml
blob1f5d3ba60bbee2f33a5ba772d4e562aa199e4d90
1 # tree mixins
2 tree_1:
3   id: 1001
4   type: TreeMixin
5   parent_id:
6   
7 tree_2:
8   id: 1002
9   type: TreeMixin
10   parent_id: 1001
12 tree_3:
13   id: 1003
14   type: TreeMixin  
15   parent_id: 1002
17 tree_4:
18   id: 1004
19   type: TreeMixin  
20   parent_id: 1001
22 tree2_1:
23   id: 1005
24   type: TreeMixin
25   parent_id:
27 tree3_1:
28   id: 1006
29   type: TreeMixin
30   parent_id:
32 tree_without_order_1:
33   id: 1101
34   type: TreeMixinWithoutOrder
35   parent_id:
37 tree_without_order_2:
38   id: 1100
39   type: TreeMixinWithoutOrder
40   parent_id:
42 recursively_cascaded_tree_1:
43   id: 5005
44   type: RecursivelyCascadedTreeMixin
45   parent_id:
47 recursively_cascaded_tree_2:
48   id: 5006
49   type: RecursivelyCascadedTreeMixin
50   parent_id: 5005
52 recursively_cascaded_tree_3:
53   id: 5007
54   type: RecursivelyCascadedTreeMixin
55   parent_id: 5006
57 recursively_cascaded_tree_4:
58   id: 5008
59   type: RecursivelyCascadedTreeMixin
60   parent_id: 5007
62 # List mixins
64 <% (1..4).each do |counter| %>  
65 list_<%= counter %>:
66   id: <%= counter+1006 %>
67   pos: <%= counter  %>
68   type: ListMixin
69   parent_id: 5
70 <% end %>
72 # Nested set mixins
74 <% (1..10).each do |counter| %>  
75 set_<%= counter %>:
76   id: <%= counter+3000 %>
77   type: NestedSet
78 <% end %>
80 # Nested set with STI
82 [ [3100,    0, 1, 10, "NestedSetSuperclass"],
83   [3101, 3100, 2, 5, "NestedSetSubclass"],
84   [3102, 3101, 3, 4, "NestedSetSuperclass"],
85   [3103, 3100, 6, 9, "NestedSetSuperclass"],
86   [3104, 3103, 7, 8, "NestedSetSubclass"]
87 ].each do |sti| %>
88 sti_set_<%= sti[0] %>:
89   id: <%= sti[0] %>
90   parent_id: <%= sti[1] %>
91   lft: <%= sti[2] %>
92   rgt: <%= sti[3] %>
93   type: <%= sti[4] %>
94   root_id: 3100
95   
96 <% end %>
98 # Big old set
100 [[4001, 0, 1, 20],
101   [4002, 4001, 2, 7],
102   [4003, 4002, 3, 4],
103   [4004, 4002, 5, 6],
104   [4005, 4001, 14, 13],
105   [4006, 4005, 9, 10],
106   [4007, 4005, 11, 12],
107   [4008, 4001, 8, 19],
108   [4009, 4008, 15, 16],
109   [4010, 4008, 17, 18]].each do |set| %>
110 tree_<%= set[0] %>:
111   id: <%= set[0]%>
112   parent_id: <%= set[1]%>
113   type: NestedSetWithStringScope
114   lft: <%= set[2]%>
115   rgt: <%= set[3]%>
116   root_id: 42
118 <% end %>
120 # subclasses of list items
121 <% (1..4).each do |i| %>
122 list_sub_<%= i %>:
123   id: <%= i + 5000 %>
124   pos: <%= i %>
125   parent_id: 5000
126   type: <%= (i % 2 == 1) ? ListMixinSub1 : ListMixinSub2 %> 
127 <% end %>