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)


Added by Gregor Schmidt at 2011-08-10 05:54 pm. Updated at 2011-08-21 03:58 pm.


Status:Closed Start date:2011-08-10
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:2.2.0
Remote issue URL: Affected version:master

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

Revision 962b35e1
Added by Gregor Schmidt at 2011-08-11 10:05 am

[#573] Being more explicit about search fields to make sure, that AR joins all tables properly

Revision 3d03a3ed
Added by Felix Schäfer at 2011-08-21 05:56 pm

Merge pull request #96 from finnlabs/pulls/573/fix_aas_in_wiki_content

[#573] acts_as_searchable definition in WikiPage may be insufficient and cause SQL errors

History

Updated by Gregor Schmidt at 2011-08-11 08:50 am

  • 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

Also available in: Atom PDF