Model#search: refactor searching for attributes.

This commit is contained in:
evazion
2019-08-29 20:24:52 -05:00
parent 6fc4b63fa8
commit 7b8584e3b0
26 changed files with 90 additions and 212 deletions

View File

@@ -133,8 +133,8 @@ class ForumTopicTest < ActiveSupport::TestCase
end
should "be searchable by title" do
assert_equal(1, ForumTopic.attribute_matches(:title, "xxx").count)
assert_equal(0, ForumTopic.attribute_matches(:title, "aaa").count)
assert_equal(1, ForumTopic.search(title: "xxx").count)
assert_equal(0, ForumTopic.search(title: "aaa").count)
end
should "be searchable by category id" do