Skip to content

A platform for community discussion. Free, open, simple.

DEV: Make `TopicLink.apply_link_visibility_filters` a private class method (#38541)

Isaac Janzen5d603ece49a2
diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb
index fdace59cb60..30c9f6c7a7f 100644
--- a/app/models/topic_link.rb
+++ b/app/models/topic_link.rb
@@ -200,8 +200,6 @@ class TopicLink < ActiveRecord::Base
lookup
end
- private
-
def self.apply_link_visibility_filters(builder, link:, target_topic:, target_posts:)
builder.where(<<~SQL)
#{target_topic}.deleted_at IS NULL
@@ -209,6 +207,9 @@ class TopicLink < ActiveRecord::Base
AND (#{link}.link_post_id IS NULL OR (#{target_posts}.id IS NOT NULL AND #{target_posts}.deleted_at IS NULL))
SQL
end
+ private_class_method :apply_link_visibility_filters
+
+ private
# This pattern is used to create topic links very efficiently with minimal
# errors under heavy concurrent use