阅读背景:

使用associated_against的pg_search给出错误“column [model_name]。[associated_column_name]不存在”

来源:互联网 

I'm trying to use pg_search to search through an associated model. When I run a search I get the error "PG::Error: ERROR: column plans.name does not exist". I'm running the search in the "plans" model and trying to search against association the "place" with a column "name". The has_many :through model that connects these is polymorphic. Somehow the sql query is combining the two and throwing an error. I've run the associated_against migration (rails g pg_search:migration:associated_against), scoured the documentation, and looked for others with the error and come up with nothing, it must be that I'm just overlooking something. It runs correctly (without the more extensive search results) if I just remove the associated_against line in plan.rb. Any help would be appreciated!I'm trying to use pg_search to search through a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: