awesome_nested_set_jrmurad 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ sqlite3:
2
+ adapter: sqlite3
3
+ database: awesome_nested_set.sqlite3.db
4
+ sqlite3mem:
5
+ adapter: sqlite3
6
+ database: ":memory:"
7
+ postgresql:
8
+ adapter: postgresql
9
+ username: postgres
10
+ password: postgres
11
+ database: awesome_nested_set_plugin_test
12
+ min_messages: ERROR
13
+ mysql:
14
+ adapter: mysql
15
+ host: localhost
16
+ username: root
17
+ password:
18
+ database: awesome_nested_set_plugin_test
@@ -0,0 +1,30 @@
1
+ ActiveRecord::Schema.define(:version => 0) do
2
+
3
+ create_table :categories, :force => true do |t|
4
+ t.column :name, :string
5
+ t.column :parent_id, :integer
6
+ t.column :lft, :integer
7
+ t.column :rgt, :integer
8
+ t.column :organization_id, :integer
9
+ end
10
+
11
+ create_table :departments, :force => true do |t|
12
+ t.column :name, :string
13
+ end
14
+
15
+ create_table :notes, :force => true do |t|
16
+ t.column :body, :text
17
+ t.column :parent_id, :integer
18
+ t.column :lft, :integer
19
+ t.column :rgt, :integer
20
+ t.column :notable_id, :integer
21
+ t.column :notable_type, :string
22
+ end
23
+
24
+ create_table :renamed_columns, :force => true do |t|
25
+ t.column :name, :string
26
+ t.column :mother_id, :integer
27
+ t.column :red, :integer
28
+ t.column :black, :integer
29
+ end
30
+ end
@@ -0,0 +1,34 @@
1
+ top_level:
2
+ id: 1
3
+ name: Top Level
4
+ lft: 1
5
+ rgt: 10
6
+ child_1:
7
+ id: 2
8
+ name: Child 1
9
+ parent_id: 1
10
+ lft: 2
11
+ rgt: 3
12
+ child_2:
13
+ id: 3
14
+ name: Child 2
15
+ parent_id: 1
16
+ lft: 4
17
+ rgt: 7
18
+ child_2_1:
19
+ id: 4
20
+ name: Child 2.1
21
+ parent_id: 3
22
+ lft: 5
23
+ rgt: 6
24
+ child_3:
25
+ id: 5
26
+ name: Child 3
27
+ parent_id: 1
28
+ lft: 8
29
+ rgt: 9
30
+ top_level_2:
31
+ id: 6
32
+ name: Top Level 2
33
+ lft: 11
34
+ rgt: 12
@@ -0,0 +1,15 @@
1
+ class Category < ActiveRecord::Base
2
+ acts_as_nested_set
3
+
4
+ def to_s
5
+ name
6
+ end
7
+
8
+ def recurse &block
9
+ block.call self, lambda{
10
+ self.children.each do |child|
11
+ child.recurse &block
12
+ end
13
+ }
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ top:
2
+ id: 1
3
+ name: Top
@@ -0,0 +1,38 @@
1
+ scope1:
2
+ id: 1
3
+ body: Top Level
4
+ lft: 1
5
+ rgt: 10
6
+ notable_id: 1
7
+ notable_type: Category
8
+ child_1:
9
+ id: 2
10
+ body: Child 1
11
+ parent_id: 1
12
+ lft: 2
13
+ rgt: 3
14
+ notable_id: 1
15
+ notable_type: Category
16
+ child_2:
17
+ id: 3
18
+ body: Child 2
19
+ parent_id: 1
20
+ lft: 4
21
+ rgt: 7
22
+ notable_id: 1
23
+ notable_type: Category
24
+ child_3:
25
+ id: 4
26
+ body: Child 3
27
+ parent_id: 1
28
+ lft: 8
29
+ rgt: 9
30
+ notable_id: 1
31
+ notable_type: Category
32
+ scope2:
33
+ id: 5
34
+ body: Top Level 2
35
+ lft: 1
36
+ rgt: 2
37
+ notable_id: 1
38
+ notable_type: Departments
@@ -0,0 +1,29 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
2
+ plugin_test_dir = File.dirname(__FILE__)
3
+ RAILS_ROOT = plugin_test_dir
4
+
5
+ require 'rubygems'
6
+ require 'test/unit'
7
+ require 'multi_rails_init'
8
+ require 'test_help'
9
+
10
+ require plugin_test_dir + '/../init.rb'
11
+
12
+ TestCaseClass = ActiveSupport::TestCase rescue Test::Unit::TestCase
13
+
14
+ ActiveRecord::Base.logger = Logger.new(plugin_test_dir + "/debug.log")
15
+
16
+ ActiveRecord::Base.configurations = YAML::load(IO.read(plugin_test_dir + "/db/database.yml"))
17
+ ActiveRecord::Base.establish_connection(ENV["DB"] || "sqlite3mem")
18
+ ActiveRecord::Migration.verbose = false
19
+ load(File.join(plugin_test_dir, "db", "schema.rb"))
20
+
21
+ Dir["#{plugin_test_dir}/fixtures/*.rb"].each {|file| require file }
22
+
23
+ class TestCaseClass #:nodoc:
24
+ self.fixture_path = File.dirname(__FILE__) + "/fixtures/"
25
+ self.use_transactional_fixtures = true
26
+ self.use_instantiated_fixtures = false
27
+
28
+ fixtures :categories, :notes, :departments
29
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: awesome_nested_set_jrmurad
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 4
8
+ - 3
9
+ version: 1.4.3
10
+ platform: ruby
11
+ authors:
12
+ - Brandon Keepers
13
+ - Daniel Morrison
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-09-16 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: activerecord
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ segments:
30
+ - 1
31
+ - 1
32
+ version: "1.1"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ description: An awesome nested set implementation for Active Record with modifications by bartocc, chewi, and jrmurad
36
+ email: info@collectiveidea.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - README.rdoc
43
+ files:
44
+ - .autotest
45
+ - .gitignore
46
+ - MIT-LICENSE
47
+ - README.rdoc
48
+ - Rakefile
49
+ - VERSION
50
+ - awesome_nested_set_jrmurad.gemspec
51
+ - init.rb
52
+ - lib/awesome_nested_set.rb
53
+ - lib/awesome_nested_set/helper.rb
54
+ - test/application.rb
55
+ - test/awesome_nested_set/helper_test.rb
56
+ - test/awesome_nested_set_test.rb
57
+ - test/db/database.yml
58
+ - test/db/schema.rb
59
+ - test/fixtures/categories.yml
60
+ - test/fixtures/category.rb
61
+ - test/fixtures/departments.yml
62
+ - test/fixtures/notes.yml
63
+ - test/test_helper.rb
64
+ has_rdoc: true
65
+ homepage: http://github.com/collectiveidea/awesome_nested_set
66
+ licenses: []
67
+
68
+ post_install_message:
69
+ rdoc_options:
70
+ - --main
71
+ - README.rdoc
72
+ - --inline-source
73
+ - --line-numbers
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ segments:
82
+ - 0
83
+ version: "0"
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ segments:
90
+ - 0
91
+ version: "0"
92
+ requirements: []
93
+
94
+ rubyforge_project:
95
+ rubygems_version: 1.3.7
96
+ signing_key:
97
+ specification_version: 3
98
+ summary: An awesome nested set implementation for Active Record
99
+ test_files:
100
+ - test/db/database.yml
101
+ - test/fixtures/departments.yml
102
+ - test/fixtures/categories.yml
103
+ - test/fixtures/notes.yml
104
+ - test/awesome_nested_set_test.rb
105
+ - test/db/schema.rb
106
+ - test/test_helper.rb
107
+ - test/fixtures/category.rb
108
+ - test/awesome_nested_set/helper_test.rb
109
+ - test/application.rb