Skip to content

Commit 3396490

Browse files
committed
handle unscoped with default scope
1 parent e6cebfd commit 3396490

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/closure_tree/finders.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def lowest_common_ancestor
109109
.limit(1)
110110
.pluck(:ancestor_id).first
111111

112-
unscoped.find(ancestor_id) if ancestor_id
112+
default_scoped(unscoped).find_by(primary_key => ancestor_id) if ancestor_id
113113
end
114114

115115
def find_all_by_generation(generation_level)

0 commit comments

Comments
 (0)