Class: Thredded::TopicSqlBuilder

Inherits:
TableSqlBuilder show all
Defined in:
lib/thredded/topic_sql_builder.rb

Instance Method Summary collapse

Methods inherited from TableSqlBuilder

#initialize, #sql

Constructor Details

This class inherits a constructor from Thredded::TableSqlBuilder

Instance Method Details

#apply_filters ⇒ Object



5
6
7
8
9
# File 'lib/thredded/topic_sql_builder.rb', line 5

def apply_filters
  @scope = @scope.joins(:topic_categories).where(category_id: categories) if categories.present?
  @scope = @scope.where(user_id: users) if users.present?
  @scope = DbTextSearch::FullTextSearch.new(@scope, :title).find(text) if text.present?
end