diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-11 03:09:37 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-11 03:09:37 +0000 |
commit | 11f4d28344e2b10de08a3dafdf1b0c5de34325c7 (patch) | |
tree | a35a3ada9b69d1c1ba5e71bf881143e4c1a8769f /activerecord/test/fixtures | |
parent | bc290c083c6a8d8ec1b30de423c751f451f51d6f (diff) | |
download | rails-11f4d28344e2b10de08a3dafdf1b0c5de34325c7.tar.gz rails-11f4d28344e2b10de08a3dafdf1b0c5de34325c7.tar.bz2 rails-11f4d28344e2b10de08a3dafdf1b0c5de34325c7.zip |
Moved acts_as_nested_set into a plugin of the same name on the official Rails svn (closed #9516) [josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/mixin.rb | 28 | ||||
-rw-r--r-- | activerecord/test/fixtures/mixins.yml | 18 |
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], |