{"comment":{"created_at":"2011-10-14T20:25:40Z","body":"So as far as i can tell, its this : \r\nhttps://github.com/rails/rails/blob/master/activerecord/lib/active_record/relation.rb#L523\r\nReturning both 'people' and 'xx' as valid table names, causing it to then alias the string (having a table found count greater than 1), and burning the previously defined values.","updated_at":"2011-10-14T20:25:40Z","url":"https://api.github.com/repos/Casecommons/pg_search/issues/comments/2411001","id":2411001,"user":{"avatar_url":"https://secure.gravatar.com/avatar/c401bb0c94ad2957222a36e403cbc07b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c401bb0c94ad2957222a36e403cbc07b","url":"https://api.github.com/users/tommeier","id":19973,"login":"tommeier"}},"action":"created","issue":{"number":14,"created_at":"2011-10-12T19:22:23Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi, \r\n\r\n\r\nEager loading associations seems to cause an error:\r\n\r\n`SomeSearch.pgsearch_scope('SomethingWith.com')`\r\n\r\nThis works. However, once you add eager loading, will cause it to fail :\r\n\r\n`SomeSearch.pgsearch_scope('SomethingWith.com').includes(:some_association)`\r\n\r\n    ActiveRecord::StatementInvalid: PGError: ERROR:  column \"pg_search_rank\" does not exist\r\n    LINE 1: ...SomethingWith.com' || ' ''' || ':*')))) ORDER BY pg_search_...\r\n\r\n\r\n\r\nHas anyone else faced this issue?","comments":11,"title":"Eager Loading","updated_at":"2011-10-14T20:25:41Z","url":"https://api.github.com/repos/Casecommons/pg_search/issues/14","id":1891084,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/c401bb0c94ad2957222a36e403cbc07b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c401bb0c94ad2957222a36e403cbc07b","url":"https://api.github.com/users/tommeier","id":19973,"login":"tommeier"},"html_url":"https://github.com/Casecommons/pg_search/issues/14","labels":[],"state":"open"},"legacy":{"issue_id":1891084,"comment_id":2411001}}