1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-03 21:33:48 +00:00

Fixed tournament search to search each term for both date and name

This commit is contained in:
2022-09-08 12:40:25 +00:00
parent 05acebbf5b
commit 645fb59e5b
3 changed files with 76 additions and 4 deletions

View File

@@ -221,7 +221,8 @@ class TournamentsController < ApplicationController
def index
if params[:search]
@tournaments = Tournament.limit(200).search(params[:search]).order("created_at DESC")
# @tournaments = Tournament.limit(200).search(params[:search]).order("date DESC")
@tournaments = Tournament.limit(200).search_date_name(params[:search]).order("date DESC")
else
@tournaments = Tournament.all.sort_by{|t| t.days_until_start}.first(20)
end