meta_search
meta_search copied to clipboard
Join table must be a string in a has_and_belongs_to_many association
If you have a join table for an association which is a symbol rather than a string, searching this association fails (sorry, I cant remember the exact error as I have fixed it now !) - the end result was active record trying to downcase a symbol in the count_aliases_from_table_joins method.
Changing the :join_table definition in my model to a string fixed it.
Cheers
Gary
I think this was an error in usage that would break manually-joined associations as well, and not just MetaSearch. Did joining the table yourself work OK?
Hi, The join has been working for ages in my app, it seems that it only broke MetaSearch. Changing the :join_table in the AR model fixed everything
I think it is valid to use a symbol for a join table, but haven't checked.
Thanks
Gary On 24 Jun 2011, at 15:33, ernie wrote:
I think this was an error in usage that would break manually-joined associations as well, and not just MetaSearch. Did joining the table yourself work OK?
Reply to this email directly or view it on GitHub: https://github.com/ernie/meta_search/issues/37#issuecomment-1432673