1. 07 11月, 2017 3 次提交
    • K
      Properly check transaction in persistence · 01c70324
      Keenan Brock 提交于
      ```
      [NoMethodError]: undefined method `state' for nil:NilClass  Method:[rescue in block in refresh]
      ```
      
      In `within_new_transaction`, there is the possibility that
      `begin_transaction` returns a `nil`. (i.e.: so `transaction = nil`)
      So this method is checking `transaction` for nil in 2 spots.
      
      Unfortunately, there is one line that is not checking `transaction` for `nil`
      That line, `commit_transaction`, throws an exception for us in AR 5.0.0.1
      
      The problem with the method is finally realized in the error checking itself.
      it calls `transaction.state` (i.e.: nil.state) and that is the final exception
      raised.
      
      The actual underlying (user) issue is hidden by this line.
      
      Solution is test transaction for nil.
      01c70324
    • R
      Merge pull request #31069 from danott/resolve-minitest-deprecation-in-assert_no_changes · 204b22fa
      Rafael França 提交于
      Resolve Minitest 6 deprecation in assert_no_changes
      204b22fa
    • D
      Resolve Minitest 6 deprecation in assert_no_changes · 1fe7168d
      Dan Ott 提交于
      These changes resolve a deprecation warning in `assert_no_changes`
      when asserting that an expression evaluates to `nil` before and after
      the passed block is evaluated.
      
      The smallest demonstration of this edge case:
      
      ```ruby
      assert_no_changes "nil" do
        true # noop
      end
      ```
      
      Under the covers, this is evaluating
      
      ```ruby
      assert_equal nil, nil
      ```
      
      Minitest 5 issues a deprecation warning, and Minitest will fail
      completely.
      
      For additional context, the motivations and implications of this change
      to Minitest have been discussed at length in [seattlerb/minitest#666][].
      
      [seattlerb/minitest#666]: https://github.com/seattlerb/minitest/issues/666
      1fe7168d
  2. 06 11月, 2017 13 次提交
  3. 05 11月, 2017 5 次提交
  4. 04 11月, 2017 7 次提交
  5. 03 11月, 2017 7 次提交
  6. 02 11月, 2017 5 次提交