mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 10:29:53 +01:00
remove pg_search
This commit is contained in:
parent
c14bae74d5
commit
d5c1e66b1e
6 changed files with 1 additions and 29 deletions
1
Gemfile
1
Gemfile
|
@ -119,4 +119,3 @@ gem "mail", "~> 2.7.1"
|
|||
|
||||
gem "prometheus-client", "~> 4.2"
|
||||
|
||||
gem "pg_search", "~> 2.3"
|
||||
|
|
|
@ -289,9 +289,6 @@ GEM
|
|||
ast (~> 2.4.1)
|
||||
racc
|
||||
pg (1.5.4)
|
||||
pg_search (2.3.6)
|
||||
activerecord (>= 5.2)
|
||||
activesupport (>= 5.2)
|
||||
pghero (3.3.4)
|
||||
activerecord (>= 6)
|
||||
prometheus-client (4.2.1)
|
||||
|
@ -545,7 +542,6 @@ DEPENDENCIES
|
|||
oj
|
||||
openssl (~> 3.2)
|
||||
pg
|
||||
pg_search (~> 2.3)
|
||||
pghero
|
||||
prometheus-client (~> 4.2)
|
||||
puma
|
||||
|
|
|
@ -4,6 +4,6 @@ class SearchController < ApplicationController
|
|||
query = params[:q]
|
||||
return if query.blank?
|
||||
|
||||
@results = PgSearch.multisearch(query).limit(10)
|
||||
@results = []
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
class Answer < ApplicationRecord
|
||||
extend Answer::TimelineMethods
|
||||
|
||||
include PgSearch::Model
|
||||
multisearchable against: [:content]
|
||||
|
||||
belongs_to :user, counter_cache: :answered_count
|
||||
belongs_to :question, counter_cache: :answer_count
|
||||
has_many :comments, dependent: :destroy
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
class Question < ApplicationRecord
|
||||
include Question::AnswerMethods
|
||||
|
||||
include PgSearch::Model
|
||||
multisearchable against: [:content]
|
||||
|
||||
belongs_to :user, optional: true
|
||||
has_many :answers, dependent: :destroy
|
||||
has_many :inboxes, dependent: :destroy
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
class CreatePgSearchDocuments < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
say_with_time("Creating table for pg_search multisearch") do
|
||||
create_table :pg_search_documents do |t|
|
||||
t.text :content
|
||||
t.belongs_to :searchable, polymorphic: true, index: true
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
say_with_time("Dropping table for pg_search multisearch") do
|
||||
drop_table :pg_search_documents
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue