1. 21 10月, 2017 1 次提交
  2. 24 7月, 2017 1 次提交
    • S
      Refactor Active Record to let Arel manage bind params · 213796fb
      Sean Griffin 提交于
      A common source of bugs and code bloat within Active Record has been the
      need for us to maintain the list of bind values separately from the AST
      they're associated with. This makes any sort of AST manipulation
      incredibly difficult, as any time we want to potentially insert or
      remove an AST node, we need to traverse the entire tree to find where
      the associated bind parameters are.
      
      With this change, the bind parameters now live on the AST directly.
      Active Record does not need to know or care about them until the final
      AST traversal for SQL construction. Rather than returning just the SQL,
      the Arel collector will now return both the SQL and the bind parameters.
      At this point the connection adapter will have all the values that it
      had before.
      
      A bit of this code is janky and something I'd like to refactor later. In
      particular, I don't like how we're handling associations in the
      predicate builder, the special casing of `StatementCache::Substitute` in
      `QueryAttribute`, or generally how we're handling bind value replacement
      in the statement cache when prepared statements are disabled.
      
      This also mostly reverts #26378, as it moved all the code into a
      location that I wanted to delete.
      
      /cc @metaskills @yahonda, this change will affect the adapters
      
      Fixes #29766.
      Fixes #29804.
      Fixes #26541.
      Close #28539.
      Close #24769.
      Close #26468.
      Close #26202.
      
      There are probably other issues/PRs that can be closed because of this
      commit, but that's all I could find on the first few pages.
      213796fb
  3. 20 7月, 2017 1 次提交
  4. 02 7月, 2017 1 次提交
  5. 01 7月, 2017 2 次提交
  6. 07 8月, 2016 1 次提交
  7. 13 10月, 2015 1 次提交
  8. 28 1月, 2015 1 次提交
    • S
      Remove Relation#bind_params · b06f64c3
      Sean Griffin 提交于
      `bound_attributes` is now used universally across the board, removing
      the need for the conversion layer. These changes are mostly mechanical,
      with the exception of the log subscriber. Additional, we had to
      implement `hash` on the attribute objects, so they could be used as a
      key for query caching.
      b06f64c3