I have a Person model with attributes first_name and last_name.
I want to implement autocomplete search that looks that the entire
name. Hence I have a method:
self.first_name + " " + self.last_name
Is it possible for me to query on full_name and have rails match the
first_name and last_name fields?
I currently receive this error when I try, because full_name isn't an
attribute in the database:
SQLite3::SQLException: no such column: full_name: SELECT
"people".* FROM "people" WHERE (LOWER(full_name) LIKE 'he
%') ORDER BY full_name ASC LIMIT 10