Skip to content

Commit 3e4c98b

Browse files
committed
[C] Add subject filtering
1 parent ac9f5f0 commit 3e4c98b

File tree

3 files changed

+86
-75
lines changed

3 files changed

+86
-75
lines changed

api/app/models/resource.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class Resource < ApplicationRecord
117117
after_commit :queue_fetch_thumbnail, on: [:create, :update]
118118
after_commit :trigger_event_creation, on: [:create]
119119

120-
has_keyword_search! against:%i[title description]
120+
has_keyword_search! against: %i[title description]
121121
searchkick(word_start: TYPEAHEAD_ATTRIBUTES,
122122
callbacks: :async,
123123
batch_size: 500,

api/app/models/subject.rb

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Subject < ApplicationRecord
99
include SerializedAbilitiesFor
1010
include Filterable
1111
include SearchIndexable
12+
include HasKeywordSearch
1213

1314
# Associations
1415
has_many :text_subjects, dependent: :destroy
@@ -40,6 +41,7 @@ class Subject < ApplicationRecord
4041
alias_attribute :title, :name
4142

4243
# Search
44+
has_keyword_search! against: %i[name]
4345
searchkick(word_start: TYPEAHEAD_ATTRIBUTES,
4446
callbacks: :async,
4547
batch_size: 500)

0 commit comments

Comments
 (0)