Searching in a table on a column using a polymorphic relationship
I have an
I'm trying to implement a search functionality on the Account model that allows searching for accounts based on the name, which is created in a combinedName aggregated attribute.
Is there a way to solve this without changing the database tables themselves?
The below code doesn't work because there's not an
Account model that has a Contact relation. The Contact relation can represent different entities: Customer or Employee. Customers has a field named cust_name.Employees has a field named emp_name.I'm trying to implement a search functionality on the Account model that allows searching for accounts based on the name, which is created in a combinedName aggregated attribute.
Is there a way to solve this without changing the database tables themselves?
The below code doesn't work because there's not an
emp_name column in the Customers table no and no cust_name field in the Employees table.