hierarchical_db 0.1.7 → 0.1.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb1bff5d5a235429700e33faf57b201c66a0d417
4
- data.tar.gz: ba810cac9d8d00a78be0f1733c8064574f9dec08
3
+ metadata.gz: 8f7c6a0c377dd9cdbac0f86ffce7156ee192b729
4
+ data.tar.gz: 47656c44af51dad752cf3bed95e1b7e1ec0d0167
5
5
  SHA512:
6
- metadata.gz: 5379fb5d9b2e922bcb1e406c6a40cd3d40beb43e747f3ac0310a650f06ba7e450ff7ad55182a9fac8ea1c9311fc11fb0233815d4fb879bd8625c2f959c14536c
7
- data.tar.gz: a27671918c62bd6ba2d7345cef5cb47f5406df1be04339069d3b3d9837c4697f71af396b46f2205ed7bea23a2b9219e64a98f9dcccb54a3edb50ff549b644bbb
6
+ metadata.gz: 0ed4d6738d32c8a88aac196f59641d00c81ca76588e374a0d617fb62448726908a25d58595046dcde492d83731d5c3609ac21ca328aeacb7a2a941c44326d5a5
7
+ data.tar.gz: 399082663d6a8861934b149819be95e66eb557eb3c6f10c0940d94780f2117f5f01458cad4728886ef15f20249143590fde27b05b3a25bf41740da0e8e753aa3
@@ -5,7 +5,7 @@ require 'hierarchical_db/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "hierarchical_db"
8
- spec.version = "0.1.7"
8
+ spec.version = "0.1.8"
9
9
  spec.authors = ["Gustavo"]
10
10
  spec.email = ["ginzunza@rebuss.cl"]
11
11
 
@@ -65,6 +65,7 @@ module HierarchicalDb extend ActiveSupport::Concern
65
65
  #case it has descendants
66
66
  unless father.nil?
67
67
  last_brother = father.descendants.where(:rgt => father.descendants.maximum(:rgt))
68
+ #case has brothers
68
69
  unless last_brother.empty?
69
70
  last_brother = last_brother[0]
70
71
  previous_right = last_brother.rgt
@@ -78,6 +79,9 @@ module HierarchicalDb extend ActiveSupport::Concern
78
79
  t.rgt = t.rgt + 2
79
80
  t.save
80
81
  end
82
+ #case hasn't brothers
83
+ else
84
+ previous_right = father.rgt
81
85
  end
82
86
  #case it is root
83
87
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hierarchical_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo