1. 20 7月, 2016 1 次提交
  2. 19 7月, 2016 6 次提交
  3. 18 7月, 2016 5 次提交
  4. 17 7月, 2016 2 次提交
  5. 15 7月, 2016 1 次提交
  6. 14 7月, 2016 4 次提交
  7. 13 7月, 2016 1 次提交
    • J
      Create connection.active_record notification and use that to ensure that lazy- · 31a8588a
      Jeremy Wadsack 提交于
      loaded model classes have their connections wrapped in transactions.
      
      See #17776
      
      In Rails 4 config.eager_load was changed to false in the test environment. This
      means that model classes that connect to alternate databases with
      establish_connection are not loaded at start up. If use_transactional_fixtures
      is enabled, transactions are wrapped around the connections that have been
      established only at the start of the test suite. So model classes loaded later
      don't have transactions causing data created in the alternate database not to
      be removed.
      
      This change resolves that by creating a new connection.active_record
      notification that gets fired whenever a connection is established. I then added
      a subscriber after we set up transactions in the test environment to listen for
      additional connections and wrap those in transactions as well.
      31a8588a
  8. 12 7月, 2016 1 次提交
  9. 11 7月, 2016 1 次提交
    • S
      Always prefer class types to query types when casting `group` · a45363a2
      Sean Griffin 提交于
      When `group` is used in combination with any calculation method, the
      resulting hash uses the grouping expression as the key. Currently we're
      incorrectly always favoring the type reported by the query, instead of
      the type known by the class. This causes differing behavior depending on
      whether the adaptor actually gives proper types with the query or not.
      After this change, the behavior will be the same on all adaptors -- we
      see if we know the type from the class, fall back to the type from the
      query, and finally fall back to the identity type.
      
      Fixes #25595
      a45363a2
  10. 09 7月, 2016 1 次提交
    • R
      fix to_param to maximize content · 3b49d792
      Rob Biedenharn 提交于
      The documentation states that parameter values longer than 20 characters
      will be truncated by words, but the example shows that a parameter based
      on "David Heinemeier Hansson" (with id: 125) becomes "125-david" when
      "David Heinemeier".length == 16 so why so short?
      
      The answer lies in the use of the #truncate option omission: nil which
      seems to have been intended to mean "nothing", but which actually causes
      the default string "..." to be used. This causes #truncate to cleave
      words until the "..." can be added and still remain within the requested
      size of 20 characters.
      
      The better option is omission: '' (which is probably what was originally
      intended).
      
      Furthermore, since the use of #parameterize will remove non-alphanumeric
      characters, we can maximize the useful content of the output by calling
      parameterize first and then giving truncate a separator: /-/ rather than
      a space.
      3b49d792
  11. 08 7月, 2016 1 次提交
  12. 06 7月, 2016 5 次提交
  13. 04 7月, 2016 3 次提交
  14. 03 7月, 2016 2 次提交
    • W
      Clarify Postgres initials. [skip ci] · b7f4b8e0
      William Johnston 提交于
      b7f4b8e0
    • B
      Improve error message when record touch fails. · ac156060
      Ben Standefer 提交于
      The current error message only indicates that a touch can fail because the record is new. In practice, we saw cases where touches were failing because the record had been destroyed. `persisted?` checks `new_record?` *and* `destroyed?`. It was confusing to get a message about a new record when in reality we were destroying records.
      
      I also included a helpful tip for users to consider using `persisted?`, `new_record?`, or `destroyed?` before touching.
      ac156060
  15. 02 7月, 2016 4 次提交
  16. 01 7月, 2016 1 次提交
  17. 29 6月, 2016 1 次提交