nested_set 1.6.2 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/nested_set/depth.rb +1 -0
- data/nested_set.gemspec +2 -2
- data/test/nested_set_test.rb +3 -3
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.3
|
data/lib/nested_set/depth.rb
CHANGED
@@ -23,6 +23,7 @@ module CollectiveIdea #:nodoc:
|
|
23
23
|
def update_depth
|
24
24
|
depth_delta = level - depth
|
25
25
|
if depth_delta != 0
|
26
|
+
self.depth += depth_delta
|
26
27
|
self.self_and_descendants.update_all(["#{self.class.quoted_depth_column_name} = #{self.class.quoted_depth_column_name} + ?", depth_delta])
|
27
28
|
end
|
28
29
|
end
|
data/nested_set.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{nested_set}
|
8
|
-
s.version = "1.6.
|
8
|
+
s.version = "1.6.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brandon Keepers", "Daniel Morrison"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-01-02}
|
13
13
|
s.description = %q{An awesome nested set implementation for Active Record}
|
14
14
|
s.email = %q{info@collectiveidea.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/test/nested_set_test.rb
CHANGED
@@ -200,12 +200,12 @@ class NestedSetTest < ActiveSupport::TestCase
|
|
200
200
|
def test_depth_after_move
|
201
201
|
categories(:child_2).move_to_root
|
202
202
|
|
203
|
-
assert_equal 0, categories(:child_2).
|
204
|
-
assert_equal 1, categories(:child_2_1).
|
203
|
+
assert_equal 0, categories(:child_2).depth
|
204
|
+
assert_equal 1, categories(:child_2_1).depth
|
205
205
|
|
206
206
|
categories(:child_2).move_to_child_of(categories(:top_level_2))
|
207
207
|
|
208
|
-
assert_equal 1, categories(:child_2).
|
208
|
+
assert_equal 1, categories(:child_2).depth
|
209
209
|
assert_equal 2, categories(:child_2_1).reload.depth
|
210
210
|
end
|
211
211
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 1.6.
|
8
|
+
- 3
|
9
|
+
version: 1.6.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Brandon Keepers
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-02 00:00:00 +03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -153,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
153
153
|
requirements:
|
154
154
|
- - ">="
|
155
155
|
- !ruby/object:Gem::Version
|
156
|
-
hash:
|
156
|
+
hash: 768447921
|
157
157
|
segments:
|
158
158
|
- 0
|
159
159
|
version: "0"
|