Skip to content

Commit

Permalink
fix ci standardrb issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Waishnav committed Aug 20, 2024
1 parent 05a1123 commit c36c160
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/simple_discussion/forum_threads_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def destroy
def search
if params[:query].present?
@forum_threads = topic_search(params[:query])
.includes(:user, :forum_category)
.paginate(per_page: 10, page: page_number)
.includes(:user, :forum_category)
.paginate(per_page: 10, page: page_number)
else
index
return
Expand Down
4 changes: 2 additions & 2 deletions test/dummy/app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ApplicationHelper
# simple sql query implementation of basic_search, this helper method can be complex as it you wanted it to be
def topic_search(query)
ForumThread.joins(:forum_posts)
.where("forum_threads.title LIKE :query OR forum_posts.body LIKE :query", query: "%#{query}%")
.distinct
.where("forum_threads.title LIKE :query OR forum_posts.body LIKE :query", query: "%#{query}%")
.distinct
end
end

0 comments on commit c36c160

Please sign in to comment.