Refactor searching text attributes.
* Allow using ApplicationRecord#attribute_matches to search text attributes, and standardize models on using this instead of duplicating code. * Remove restrictions that limited wildcard searches to Builders only in various places.
This commit is contained in:
@@ -164,8 +164,8 @@ class ForumPostTest < ActiveSupport::TestCase
|
||||
|
||||
should "be searchable by body content" do
|
||||
post = FactoryBot.create(:forum_post, :topic_id => @topic.id, :body => "xxx")
|
||||
assert_equal(1, ForumPost.body_matches("xxx").count)
|
||||
assert_equal(0, ForumPost.body_matches("aaa").count)
|
||||
assert_equal(1, ForumPost.search(body_matches: "xxx").count)
|
||||
assert_equal(0, ForumPost.search(body_matches: "aaa").count)
|
||||
end
|
||||
|
||||
should "initialize its creator" do
|
||||
|
||||
Reference in New Issue
Block a user