parentry 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 261e45f2ceb096605d761ed6a774684edc24c53a
4
- data.tar.gz: 42d22ad8ccc1f2217b67ad6af01fff03dd85a454
3
+ metadata.gz: 338c1bb54b4ba0d2899eb63fc7c3c91c7188c5f7
4
+ data.tar.gz: c2f19d677f76b94aa37e5990ecd5de3202574501
5
5
  SHA512:
6
- metadata.gz: c63b998524c891a393505a8464b668338f0bd9f06936884315b092a46bc962c7eaf6a28f5d0e548d569fc29c2749e4b33dee99dc30aca10567b4dbdb22f9c320
7
- data.tar.gz: e20688b736eac361ac213242cdbd1eff5116f316ccb863de1dabdf11878f45c901357a126dcc84e8c037e3913820ef8ed9315a994c10d27c026412e576879779
6
+ metadata.gz: 1364062a29ed0bbd53a57ca25067f0db06deda7ab6fe3fbcc0b787583a92e8ec2be6a5cc9026d594de6331efae0883f7795c4a421d5024a7aaf39e6fc0b713f3
7
+ data.tar.gz: 0f5aeda294cb23768a2df88e9f63b64d707acdca9edc5bc037b9ead5edec3ed19f3257082ddfa5c3d2df5cbd1c06ef4df37896766acb7395a8767b792e5e67d5
@@ -79,7 +79,8 @@ module Parentry
79
79
 
80
80
  def depth
81
81
  return depth_offset if root?
82
- parent.depth + 1
82
+ return parent.depth + 1 if changes[:parent_id].present?
83
+ path_ids.size - 1 + depth_offset
83
84
  end
84
85
 
85
86
  private
@@ -1,3 +1,3 @@
1
1
  module Parentry
2
- VERSION = '0.3.1'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parentry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hamed Asghari