diff options
Diffstat (limited to 'app/finders/labels_finder.rb')
-rw-r--r-- | app/finders/labels_finder.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/finders/labels_finder.rb b/app/finders/labels_finder.rb index b1387f2a104..1bf2e3b71e4 100644 --- a/app/finders/labels_finder.rb +++ b/app/finders/labels_finder.rb @@ -24,6 +24,7 @@ class LabelsFinder < UnionFinder items = with_title(items) items = by_subscription(items) items = by_search(items) + items = by_locked_labels(items) items = items.with_preloaded_container if @preload_parent_association sort(items) @@ -94,6 +95,12 @@ class LabelsFinder < UnionFinder labels.optionally_subscribed_by(subscriber_id) end + def by_locked_labels(items) + return items unless params[:locked_labels] + + items.with_lock_on_merge + end + def subscriber_id current_user&.id if subscribed? end |