aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r--activerecord/test/fixtures/mixin.rb28
-rw-r--r--activerecord/test/fixtures/mixins.yml18
2 files changed, 28 insertions, 18 deletions
diff --git a/activerecord/test/fixtures/mixin.rb b/activerecord/test/fixtures/mixin.rb
index 5e40c397c0..358dde1ae1 100644
--- a/activerecord/test/fixtures/mixin.rb
+++ b/activerecord/test/fixtures/mixin.rb
@@ -43,3 +43,31 @@ end
class NestedSetSubclass < NestedSetSuperclass
end
+
+class NestedSet < Mixin
+ acts_as_nested_set :scope => "root_id IS NULL"
+
+ def self.table_name() "mixins" end
+end
+
+class NestedSetWithStringScope < Mixin
+ acts_as_nested_set :scope => 'root_id = #{root_id}'
+
+ def self.table_name() "mixins" end
+end
+
+class NestedSetWithSymbolScope < Mixin
+ acts_as_nested_set :scope => :root
+
+ def self.table_name() "mixins" end
+end
+
+class NestedSetSuperclass < Mixin
+ acts_as_nested_set :scope => :root
+
+ def self.table_name() "mixins" end
+end
+
+class NestedSetSubclass < NestedSetSuperclass
+
+end
diff --git a/activerecord/test/fixtures/mixins.yml b/activerecord/test/fixtures/mixins.yml
index 6c66eb559c..c79ff41070 100644
--- a/activerecord/test/fixtures/mixins.yml
+++ b/activerecord/test/fixtures/mixins.yml
@@ -68,24 +68,6 @@ set_<%= counter %>:
type: NestedSet
<% end %>
-# Nested set with STI
-<%
-[ [3100, 0, 1, 10, "NestedSetSuperclass"],
- [3101, 3100, 2, 5, "NestedSetSubclass"],
- [3102, 3101, 3, 4, "NestedSetSuperclass"],
- [3103, 3100, 6, 9, "NestedSetSuperclass"],
- [3104, 3103, 7, 8, "NestedSetSubclass"]
-].each do |sti| %>
-sti_set_<%= sti[0] %>:
- id: <%= sti[0] %>
- parent_id: <%= sti[1] %>
- lft: <%= sti[2] %>
- rgt: <%= sti[3] %>
- type: <%= sti[4] %>
- root_id: 3100
-
-<% end %>
-
# Big old set
<%
[[4001, 0, 1, 20],