diff --git a/app/models/article.rb b/app/models/article.rb index ec14176b..3ba7137b 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -85,7 +85,7 @@ def self.text_search(query, scope = nil) scope ||= current if query.present? - scope.search(query).with_pg_search_highlight + scope.reorder(nil).search(query).with_pg_search_highlight else scope end diff --git a/spec/models/article_search_spec.rb b/spec/models/article_search_spec.rb index c48e9330..28750056 100644 --- a/spec/models/article_search_spec.rb +++ b/spec/models/article_search_spec.rb @@ -88,8 +88,6 @@ before do @title_match = create(:article, title: "Security Best Practices") @content_match = create(:article, content: "We have a number of security best practices, some of which don't make a lot of sense.") - - skip "not working right yet" end subject(:search) { Article.text_search("security best practices") }