Rails 4.1.1 w/ pg_search - “PG::SyntaxError: ERROR: syntax error at or near ”AS“” Bug

亡梦爱人 提交于 2019-12-03 08:20:43

@supports.count(:all) should work, the @supports.count syntax got deprecated in rails 4.1.1

There is a good conversation here to clarify the problem.

This is weird - when i call

=@supports.count

the error is generated but it is a valid object. It's a bit hacky but this is working for now:

=@supports.to_a.count
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!