2005-04-17 05:52:12 -04:00
|
|
|
# Nested set mixins
|
|
|
|
|
|
|
|
<% (1..10).each do |counter| %>
|
|
|
|
set_<%= counter %>:
|
|
|
|
id: <%= counter+3000 %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
# Big old set
|
|
|
|
<%
|
|
|
|
[[4001, 0, 1, 20],
|
|
|
|
[4002, 4001, 2, 7],
|
|
|
|
[4003, 4002, 3, 4],
|
|
|
|
[4004, 4002, 5, 6],
|
2007-05-30 02:34:25 -04:00
|
|
|
[4005, 4001, 14, 13],
|
2005-04-17 05:52:12 -04:00
|
|
|
[4006, 4005, 9, 10],
|
|
|
|
[4007, 4005, 11, 12],
|
2007-05-30 02:34:25 -04:00
|
|
|
[4008, 4001, 8, 19],
|
2005-04-17 05:52:12 -04:00
|
|
|
[4009, 4008, 15, 16],
|
|
|
|
[4010, 4008, 17, 18]].each do |set| %>
|
|
|
|
tree_<%= set[0] %>:
|
|
|
|
id: <%= set[0]%>
|
|
|
|
parent_id: <%= set[1]%>
|
|
|
|
type: NestedSetWithStringScope
|
|
|
|
lft: <%= set[2]%>
|
|
|
|
rgt: <%= set[3]%>
|
|
|
|
root_id: 42
|
|
|
|
|
|
|
|
<% end %>
|
2005-11-10 01:19:50 -05:00
|
|
|
|