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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efa129f338ec6582601314bec7c0c121eed62ea1
4
- data.tar.gz: e424e02dd6da7331ae1453c622be5b52ccb2c975
3
+ metadata.gz: 36fc7e3900e483ed1185826c883f7a224388f085
4
+ data.tar.gz: d4a96aeb0141b6835ab8a1c7b821c9ce8e6c2715
5
5
  SHA512:
6
- metadata.gz: f4589e5f43d8d3897938598b08cfa217f300dd5a9dc1c59b843ff7490bd416e6be668cc6cfb1f2f0bdc428af9cbc373b715b873d21ae2fca80b2430763542c93
7
- data.tar.gz: 0b5723cb07c17feccc683a08dbe531c433fa5aabfa1ca945231bfe4023a952fd0446a260e7b76107dec214c2bc5966b2893f590cc24c1ff6e9023b63737c7937
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
@@ -1,3 +1,3 @@
1
1
  module ActsAsManyTrees
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-12 00:00:00.000000000 Z
11
+ date: 2015-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails