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 +4 -4
- data/lib/acts_as_many_trees/base.rb +2 -1
- data/lib/acts_as_many_trees/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 094bc99bd5e478b9b778e43278cd110fe32eef91
|
4
|
+
data.tar.gz: 996eba95fb96a54ce14006a2decbf3f345aee9b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|