acts_as_many_trees 0.2.0 → 0.2.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: 4cb9522ff927a74b55edbe763d0d20f035e862d9
4
- data.tar.gz: 86bb4f983cc3de97fde2809852b1d0f98c293b32
3
+ metadata.gz: 094bc99bd5e478b9b778e43278cd110fe32eef91
4
+ data.tar.gz: 996eba95fb96a54ce14006a2decbf3f345aee9b9
5
5
  SHA512:
6
- metadata.gz: c1861df1b3c04446f86761ea74a26325993cf840b4c77417135d70bca9166257da786a94208953a4990744e0cc0bb770e3203a9ab0794fe5f19534f34f5b2a58
7
- data.tar.gz: c47ce4acd75e28b18c49ad7ceca5e66daa775ed05b0a89e7ece1bdf8975a0b2e475ccc584fc00c91f3a9d2678f9fefd2a0d75835868ec0b878e3947357c6a09b
6
+ metadata.gz: 0ba57d028d70f361b68fdb6a9548e05a00bd18f9b189033214311808b060f5d78efb978250265417d82f16c50745ae4d121311a86a4fab13001773d4e2943c73
7
+ data.tar.gz: a42db790f468e0aaedaf6ca43418b1e4277643dde0eed558b5ed7891f84487e91a0f61293ba5f7c1d2e2b5f25518ddca3b5d0bffa33c2ea20b83c648ec809282
@@ -136,7 +136,8 @@ module ActsAsManyTrees
136
136
  end
137
137
 
138
138
  def position(tree_name=self.default_tree_name)
139
- unscoped_ancestor_links.where(ancestor_id: id,hierarchy_scope: tree_name).first.position
139
+ link = unscoped_ancestor_links.where(ancestor_id: id,hierarchy_scope: tree_name).first
140
+ link ? link.position: 0
140
141
  end
141
142
  end
142
143
  end
@@ -1,3 +1,3 @@
1
1
  module ActsAsManyTrees
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_many_trees
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Small