代码之家  ›  专栏  ›  技术社区  ›  Mateusz Urbański

Ruby on Rails where_values方法

  •  1
  • Mateusz Urbański  · 技术社区  · 7 年前

    在rubyonrails4中 where_values 方法:

    User.with_all_credentials(creds).where_values
    [
        [0] "lower(email) = 'test'"
    ]
    

    在rubyonrails5中,当我尝试执行同样的操作时,它返回我这个方法不存在。如何在rubyonrails5中获得相同的结果?

    1 回复  |  直到 7 年前
        1
  •  2
  •   Aleksei Matiushkin    7 年前

    正如在Rails代码中很容易看到的,现在 where_clause

    (因为 where 现在住在 CLAUSE_METHODS .)