searchable: fix searching for polymorphic attributes.
Fix not being able to use the full set of search operators on polymorphic `model_id` and `model_type` attributes. Before things like `search[model_type]=Post` worked, but `search[model_type_not_eq]=Post` or other `model_type_*` operators didn't.
This commit is contained in:
@@ -229,6 +229,9 @@ class SearchableTest < ActiveSupport::TestCase
|
||||
assert_search_equals(@mr2, model_type: "ForumPost", model_id: @mr2.model.id)
|
||||
assert_search_equals(@mr3, model_type: "Dmail", model_id: @mr3.model.id)
|
||||
|
||||
assert_search_equals([@mr2, @mr1], model_type_not_eq: "Dmail")
|
||||
assert_search_equals([], model_type: "Dmail", model_id_not_eq: @mr3.model_id)
|
||||
|
||||
assert_search_equals(@mr1, Comment: { body: @mr1.model.body })
|
||||
assert_search_equals(@mr2, ForumPost: { body: @mr2.model.body })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user