simple_nested_set 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -71,7 +71,9 @@ module SimpleNestedSet
71
71
  when :child ; target.rgt
72
72
  when :left ; target.lft
73
73
  when :right ; target.rgt + 1
74
- when :root ; roots.empty? ? 1 : roots.where('id <> ?', node.id).last.rgt + 1
74
+ when :root
75
+ r = roots.where('id <> ?', node.id)
76
+ r.empty?? 1 : r.last.rgt + 1
75
77
  end
76
78
  bound > node.rgt ? bound - 1 : bound
77
79
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleNestedSet
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_nested_set
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sven Fuchs
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-03-29 00:00:00 +02:00
19
+ date: 2011-04-27 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency