Fix ApplicationRecord#search_attribute (fixup 2b4ee0ee).

`column.array?` failed when the column was actually an association.
This commit is contained in:
evazion
2019-09-27 20:43:21 -05:00
parent 6f0b58ad49
commit 9000bc5cc6

View File

@@ -104,7 +104,7 @@ class ApplicationRecord < ActiveRecord::Base
column = column_for_attribute(name)
type = column.type || reflect_on_association(name)&.class_name
if column.array?
if column.try(:array?)
return search_array_attribute(name, type, params)
end