1. 05 1月, 2015 1 次提交
  2. 03 12月, 2014 1 次提交
  3. 02 12月, 2014 1 次提交
  4. 30 11月, 2014 2 次提交
    • S
      Update Arel usage for rails/arel#98fc2599 · a975407a
      Sean Griffin 提交于
      `where_sql` now requires that we pass it an engine. None of the manager
      classes take an engine in their constructor.
      a975407a
    • S
      Stop using `Arel::Table.engine` · de239066
      Sean Griffin 提交于
      We never actually make use of it on the table, since we're constructing
      the select manager manually. It looks like if we ever actually were
      grabbing it from the table, we're grossly misusing it since it's meant
      to vary by AR class.
      
      Its existence on `Arel::Table` appears to be purely for convenience
      methods that are never used outside of tests. However, in production
      code it just complicates construction of the tables on the rails side,
      and the plan is to remove it from `Arel::Table` entirely. I'm not
      convinced it needs to live on `SelectManager`, etc either.
      de239066
  5. 21 11月, 2014 1 次提交
  6. 20 11月, 2014 1 次提交
  7. 18 11月, 2014 1 次提交
    • S
      rm `reorder_bind_params` · c01b20b6
      Sean Griffin 提交于
      Arel handles this for us automatically. Updated tests, as BindParam is
      no longer a subclass of SqlLiteral. We should remove the second argument
      to substitute_at entirely, as it's no longer used
      c01b20b6
  8. 02 11月, 2014 3 次提交
    • S
      Use a bound parameter for the "id = " portion of update statements · 4b534152
      Sean Griffin 提交于
      We need to re-order the bind parameters since the AST returned by the
      relation will have the where statement as the first bp, which breaks on
      PG.
      4b534152
    • S
      [ci skip] `Relation#bind` is not public API · b380b1d2
      Sean Griffin 提交于
      b380b1d2
    • S
      Use bind values for joined tables in where statements · 10f75af9
      Sean Griffin 提交于
      In practical terms, this allows serialized columns and tz aware columns
      to be used in wheres that go through joins, where they previously would
      not behave correctly. Internally, this removes 1/3 of the cases where we
      rely on Arel to perform type casting for us.
      
      There were two non-obvious changes required for this. `update_all` on
      relation was merging its bind values with arel's in the wrong order.
      Additionally, through associations were assuming there would be no bind
      parameters in the preloader (presumably because the where would always
      be part of a join)
      
      [Melanie Gilman & Sean Griffin]
      10f75af9
  9. 01 11月, 2014 1 次提交
  10. 29 10月, 2014 1 次提交
    • X
      let's warn with heredocs · b3bfa361
      Xavier Noria 提交于
      The current style for warning messages without newlines uses
      concatenation of string literals with manual trailing spaces
      where needed.
      
      Heredocs have better readability, and with `squish` we can still
      produce a single line.
      
      This is a similar use case to the one that motivated defining
      `strip_heredoc`, heredocs are super clean.
      b3bfa361
  11. 27 10月, 2014 1 次提交
  12. 20 10月, 2014 1 次提交
  13. 11 9月, 2014 1 次提交
  14. 05 9月, 2014 1 次提交
  15. 29 8月, 2014 1 次提交
    • G
      Avoid using heredoc for user warnings · 8c52480b
      Godfrey Chan 提交于
      Using heredoc would enforce line wrapping to whatever column width we decided to
      use in the code, making it difficult for the users to read on some consoles.
      
      This does make the source code read slightly worse and a bit more error-prone,
      but this seems like a fair price to pay since the primary purpose for these
      messages are for the users to read and the code will not stick around for too
      long.
      8c52480b
  16. 19 8月, 2014 1 次提交
  17. 14 8月, 2014 1 次提交
  18. 24 5月, 2014 1 次提交
  19. 23 5月, 2014 1 次提交
  20. 25 4月, 2014 1 次提交
  21. 22 4月, 2014 1 次提交
  22. 08 4月, 2014 1 次提交
    • L
      Build the reverse_order on its proper method. · 6c311e0b
      Lauro Caetano 提交于
      The reverse_order method was using a flag to control if the order should
      be reversed or not. Instead of using this variable just build the reverse order
      inside its proper method.
      
      This implementation was leading to an unexpected behavior when using
      reverse_order and then applying reorder(nil).
      
      Example:
        Before
          Post.order(:name).reverse_order.reorder(nil)
          # => SELECT "posts".* FROM "posts"   ORDER BY "posts"."id" DESC
      
        After
          Post.order(:name).reverse_order.reorder(nil)
         # => SELECT "posts".* FROM "posts"
      6c311e0b
  23. 18 3月, 2014 1 次提交
  24. 17 3月, 2014 1 次提交
  25. 15 3月, 2014 1 次提交
  26. 05 3月, 2014 3 次提交
  27. 01 3月, 2014 1 次提交
  28. 17 2月, 2014 2 次提交
  29. 02 2月, 2014 1 次提交
    • R
      Make arel methods private API · cd93d717
      Rafael Mendonça França 提交于
      Since its conception arel was made to be private API of Active Record.
      If users want to use arel features directly we should provide a way
      using the Active Record API without exposing the arel implementation.
      cd93d717
  30. 31 1月, 2014 1 次提交
  31. 30 1月, 2014 1 次提交
    • Y
      docs, `references` is only used with `includes`. Closes #13727. · 9632c986
      Yves Senn 提交于
      There is no gain in `referencing` tables that are not used for preloading.
      Furthermore it will break if polymorphic associations are invloved. This
      is because `references_eager_loaded_tables?` uses all `reference_values`
      to decide wether to `eager_load` or `preload`.
      9632c986
  32. 29 1月, 2014 1 次提交
  33. 27 1月, 2014 1 次提交
    • W
      Display value when raising due to unscope() issues · 8b14b114
      Washington Luiz 提交于
      Hopefully make it easier to debug errors. e.g
      
      Before:
      
          RuntimeError:
             unscope(where: "deleted_at") failed: unscoping String is unimplemented.
      
      After:
      
          RuntimeError:
             unscope(where: "deleted_at") failed: unscoping String "'t'='t'" is unimplemented.
      8b14b114
  34. 22 1月, 2014 1 次提交
    • Y
      prepend table name for `Relation#select` columns. · e011258c
      Yves Senn 提交于
      This fixes a bug where `select(:id)` combined with `joins()` raised:
      
      ```
      ActiveRecord::StatementInvalid: SQLite3::SQLException: ambiguous column name: id:
      SELECT  id, authors.author_address_id
      FROM "posts"
      INNER JOIN "authors"
      ON "authors"."id" = "posts"."author_id"
      ORDER BY posts.id LIMIT 3
      ```
      
      The `select_values` are still String and Symbols because other parts (mainly calculations.rb)
      rely on that fact.
      
      /cc @tenderlove
      e011258c