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

前端 未结 3 932
不思量自难忘°
不思量自难忘° 2021-02-10 09:58

I updated from RoR 4.0.4 to 4.1.1 to apply the latest security patch and it appears pg_search broke.

Here\'s a error:

PG::SyntaxError: ERROR: syn

相关标签:
3条回答
  • 2021-02-10 10:32

    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
    
    0 讨论(0)
  • 2021-02-10 10:41

    There is a good conversation here to clarify the problem.

    0 讨论(0)
  • 2021-02-10 10:48

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

    0 讨论(0)
提交回复
热议问题