acts_as_many_trees 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acts_as_many_trees/hierarchy_table.rb +2 -2
- data/lib/acts_as_many_trees/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36fc7e3900e483ed1185826c883f7a224388f085
|
4
|
+
data.tar.gz: d4a96aeb0141b6835ab8a1c7b821c9ce8e6c2715
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91837d6eac4e8e4a5f8500582699503b6563a7b7ba1bd8397e8b8ccc5e40a0ff86bdffc2b326ccd915c51f3b9ca4f5d9a1306beed5d2934e3baa234e25d728eb
|
7
|
+
data.tar.gz: cf1d3b22bd6b3d8024b080909b5b8b6e7d75e7ea96785ed0dd9a1a52122741b9a6fc27047c66e0b0591b0f5c62445ba4d7ff62ac40228b6c5fd1566b696dbecf
|
@@ -83,14 +83,14 @@ module ActsAsManyTrees
|
|
83
83
|
if new_parent
|
84
84
|
wrk_parent = self.find_by(descendant_id:new_parent.id,ancestor_id:new_parent.id,generation: 0,hierarchy_scope: hierarchy_scope)
|
85
85
|
unless wrk_parent
|
86
|
-
position = (after_this(nil,nil,hierarchy_scope)+before_this(nil,hierarchy_scope))/2.0
|
86
|
+
position = ((after_this(nil,nil,hierarchy_scope)+before_this(nil,hierarchy_scope))/2.0).round(15)
|
87
87
|
wrk_parent=self.create(descendant_id:new_parent.id,ancestor_id:new_parent.id,generation: 0,hierarchy_scope: hierarchy_scope,position: position)
|
88
88
|
end
|
89
89
|
end
|
90
90
|
if item
|
91
91
|
after_position = after_this(wrk_parent,after_node,hierarchy_scope)
|
92
92
|
before_position = before_this(before_node,hierarchy_scope)
|
93
|
-
position = (after_position+before_position)/2.0
|
93
|
+
position = ((after_position+before_position)/2.0).round(15)
|
94
94
|
wrk_item = self.find_by(descendant_id:item.id,ancestor_id:item.id,generation: 0,hierarchy_scope: hierarchy_scope)
|
95
95
|
if wrk_item
|
96
96
|
wrk_item.position = position
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_many_trees
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Small
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04
|
11
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|