I'm using thinking sphinx, with the sphinx_select parameter to create a dynamic field, like so:
@subjects = Subject.search(sphinx_select: "*, petals < 1 or color = 2 as my_attribute")
Is there any way to access custom_attribute
in the search results? For example:
@subjects.each do |s|
s.my_attribute
end
Returns
undefined method `my_attribute' for #<Subject:0x007fb25cdcdb18>