Skip to content
  • Edouard CHIN's avatar
    1585064d
    Fix inconsistency between `delete_all` & `update_all` allowed methods: · 1585064d
    Edouard CHIN authored
    - At the moment, `delete_all` doesn't support `WITH`,
      `WITH RECURSIVE` and `DISTINCT` statement.
    
      Calling `Post.with(ex: Post.where(title: "")).delete_all`
      raises an error.
      However calling `Post.with(ex: Post.where(title: "")).update_all`
      executes the following SQL `UPDATE "posts" SET "title" = blabla`,
      which can be surprising for users.
    
      This commit adds a deprecation message to warn users
      that those statements have no effect, with the intention of
      raising the same error as when using `delete_all` in a future
      Rails release.
    1585064d
    Fix inconsistency between `delete_all` & `update_all` allowed methods:
    Edouard CHIN authored
    - At the moment, `delete_all` doesn't support `WITH`,
      `WITH RECURSIVE` and `DISTINCT` statement.
    
      Calling `Post.with(ex: Post.where(title: "")).delete_all`
      raises an error.
      However calling `Post.with(ex: Post.where(title: "")).update_all`
      executes the following SQL `UPDATE "posts" SET "title" = blabla`,
      which can be surprising for users.
    
      This commit adds a deprecation message to warn users
      that those statements have no effect, with the intention of
      raising the same error as when using `delete_all` in a future
      Rails release.
Loading