mongoid_acts_as_tree 0.1.2 → 0.1.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.
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ *0.1.3 (June 15th, 2010)*
2
+ *patch from joshuabowers (http://github.com/saks/mongoid_acts_as_tree/commit/a98bb62746b71692853a91de7eb35ac55c19bf11)
3
+
4
+ *0.1.2 (April 5th, 2010)*
5
+
6
+ *Dependencies updated
7
+
1
8
  *0.1.1 (April 5th, 2010)*
2
9
 
3
10
  *Imroved #children.delete()
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -89,7 +89,7 @@ module Mongoid
89
89
 
90
90
  def ancestors
91
91
  return [] if root?
92
- self.class.find(self[path_field])
92
+ self.class.where(:_id.in => self[path_field]).order_by(depth_field)
93
93
  end
94
94
 
95
95
  def self_and_ancestors
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongoid_acts_as_tree}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jakob Vidmar, Aliaksandr Rahalevich"]
12
- s.date = %q{2010-05-04}
12
+ s.date = %q{2010-06-15}
13
13
  s.description = %q{Port of the old, venerable ActsAsTree with a bit of a twist}
14
14
  s.email = %q{saksmlz@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -35,14 +35,14 @@ Gem::Specification.new do |s|
35
35
  s.homepage = %q{http://github.com/saks/mongoid_acts_as_tree}
36
36
  s.rdoc_options = ["--charset=UTF-8"]
37
37
  s.require_paths = ["lib"]
38
- s.rubygems_version = %q{1.3.6.1}
38
+ s.rubygems_version = %q{1.3.7}
39
39
  s.summary = %q{ActsAsTree plugin for Mongoid}
40
40
  s.test_files = [
41
- "test/test_tree.rb",
42
- "test/test_order.rb",
43
- "test/models/category.rb",
41
+ "test/test_order.rb",
44
42
  "test/models/ordered_category.rb",
45
- "test/helper.rb"
43
+ "test/models/category.rb",
44
+ "test/helper.rb",
45
+ "test/test_tree.rb"
46
46
  ]
47
47
 
48
48
  if s.respond_to? :specification_version then
data/test/test_tree.rb CHANGED
@@ -62,8 +62,10 @@ class TestMongoidActsAsTree < Test::Unit::TestCase
62
62
 
63
63
  should "have ancestors" do
64
64
  assert_equal @root_1.ancestors, []
65
+ assert_equal @child_2.ancestors, [@root_1]
65
66
  assert_equal @child_2_1.ancestors, [@root_1, @child_2]
66
67
  assert_equal @root_1.self_and_ancestors, [@root_1]
68
+ assert_equal @child_2.self_and_ancestors, [@root_1, @child_2]
67
69
  assert_equal @child_2_1.self_and_ancestors, [@root_1, @child_2, @child_2_1]
68
70
  end
69
71
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jakob Vidmar, Aliaksandr Rahalevich
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-04 00:00:00 +03:00
17
+ date: 2010-06-15 00:00:00 +03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -114,13 +114,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  requirements: []
115
115
 
116
116
  rubyforge_project:
117
- rubygems_version: 1.3.6.1
117
+ rubygems_version: 1.3.7
118
118
  signing_key:
119
119
  specification_version: 3
120
120
  summary: ActsAsTree plugin for Mongoid
121
121
  test_files:
122
- - test/test_tree.rb
123
122
  - test/test_order.rb
124
- - test/models/category.rb
125
123
  - test/models/ordered_category.rb
124
+ - test/models/category.rb
126
125
  - test/helper.rb
126
+ - test/test_tree.rb