ChiliProject is not maintained anymore. Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.
acts_as_searchable definition in WikiPage may be insufficient and cause SQL errors (Bug #573)
Description
The find option :include will not always cause a JOIN. Therefore conditions need to explictly reference the joined table, to make it work. This is not done for the join performed by acts_as_searchable
in app/models/wiki_page.rb
See comments on APIDock:"http://apidock.com/rails/ActiveRecord/Base/find/class#163-Specifying-include-no-longer-necessarily-joins-the-association" for more detailed explanation
We are running into this issue in one of our plugins cucumber steps. I was not able to reproduce this issue outside of cucumber, but I guess the proposed change is small enough and conforms to best practices, so that is should be fine to add, even without a proper way to reproduce the error.
Pull request on the way.
Associated revisions
[#573] Being more explicit about search fields to make sure, that AR joins all tables properly
History
Updated by Gregor Schmidt at 2011-08-11 08:50 am
Pull request is at https://github.com/chiliproject/chiliproject/pull/96
- Assignee deleted (
Gregor Schmidt) - Status changed from Open to Ready for review
Updated by Felix Schäfer at 2011-08-21 03:58 pm
If column names are explicitly given, they should be full column names with the table name. Committed in 3d03a3e, thanks.
- (deleted custom field) set to master
- Status changed from Ready for review to Closed