1. 09 11月, 2017 12 次提交
  2. 08 11月, 2017 2 次提交
  3. 07 11月, 2017 3 次提交
    • R
      Remove useless `associated_records_by_owner` · 3f1695bb
      Ryuta Kamizono 提交于
      `associated_records_by_owner` had returned customizing result before
      calling `associate_records_to_owner` for through association subclasses.
      Since #22115, `associate_records_to_owner` is called in the method and
      not returned owner and result pairs. Removing the method will reduce
      method call and block call nesting.
      3f1695bb
    • B
      Fix `bin/rails db:migrate` with specified `VERSION` · 90fe2a42
      bogdanvlviv 提交于
      Ensure that `bin/rails db:migrate` with specified `VERSION` reverts
      all migrations only if `VERSION` is `0`.
      Raise error if target migration doesn't exist.
      90fe2a42
    • 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
  4. 06 11月, 2017 6 次提交
  5. 03 11月, 2017 1 次提交
    • Y
      Remove unused classes · 0d7ab973
      yuuji.yaginuma 提交于
      * `HasManyThroughCantDissociateNewRecords` and `HasManyThroughCantAssociateNewRecords`
      are no longer used since f6b12c11.
      * `ReadOnlyAssociation` is no longer used since 0da426be.
      0d7ab973
  6. 01 11月, 2017 2 次提交
    • R
      Enable `Style/RedundantReturn` rubocop rule, and fixed a couple more · 146b1c2e
      Ryuta Kamizono 提交于
      Follow up of #31004.
      146b1c2e
    • Y
      Address incorrect number of queries executed at Oracle enhanced adapter · 82e973df
      Yasuo Honda 提交于
      This pull request addresses these 17 failures when tested with Oracle enhanced adapter.
      All of these failures are due to the incorrect number of queries. Here is the first one.
      
      ```ruby
      $ ARCONN=oracle bin/test test/cases/nested_attributes_test.rb:1086
      Using oracle
      Run options: --seed 27985
      
      F
      
      Finished in 0.874514s, 1.1435 runs/s, 1.1435 assertions/s.
      
        1) Failure:
      TestHasManyAutosaveAssociationWhichItselfHasAutosaveAssociations#test_circular_references_do_not_perform_unnecessary_queries [/home/yahonda/git/rails/activerecord/test/cases/nested_attributes_test.rb:1086]:
      6 instead of 3 queries were executed.
      Queries:
      select us.sequence_name from all_sequences us where us.sequence_owner = :owner and us.sequence_name = :sequence_name
      INSERT INTO "SHIPS" ("NAME", "ID") VALUES (:a1, :a2)
      select us.sequence_name from all_sequences us where us.sequence_owner = :owner and us.sequence_name = :sequence_name
      INSERT INTO "SHIP_PARTS" ("NAME", "SHIP_ID", "UPDATED_AT", "ID") VALUES (:a1, :a2, :a3, :a4)
      select us.sequence_name from all_sequences us where us.sequence_owner = :owner and us.sequence_name = :sequence_name
      INSERT INTO "TREASURES" ("LOOTER_ID", "LOOTER_TYPE", "SHIP_ID", "ID") VALUES (:a1, :a2, :a3, :a4).
      Expected: 3
        Actual: 6
      
      1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
      $
      ```
      
      Since https://github.com/rsim/oracle-enhanced/pull/1490 Oracle enhanced adapter drops its own schema caching called OracleEnhancedAdapter.cache_columns` to use Rails scehema cache
      generated by `db:schema:cache:dump`.
      
      By this change some extra sql statements executed at ActiveRecord unit test, which can be
      fixed by adding the sql statement to `oracle_ignored`.
      
      * All 17 failures fixed by this pull request:
      ```ruby
      ARCONN=oracle bin/test test/cases/nested_attributes_test.rb:1086
      ARCONN=oracle bin/test test/cases/locking_test.rb:308
      ARCONN=oracle bin/test test/cases/locking_test.rb:365
      ARCONN=oracle bin/test test/cases/dirty_test.rb:351
      ARCONN=oracle bin/test test/cases/dirty_test.rb:334
      ARCONN=oracle bin/test test/cases/autosave_association_test.rb:192
      ARCONN=oracle bin/test test/cases/associations/has_many_associations_test.rb:950
      ARCONN=oracle bin/test test/cases/associations/has_many_associations_test.rb:1059
      ARCONN=oracle bin/test test/cases/autosave_association_test.rb:627
      ARCONN=oracle bin/test test/cases/autosave_association_test.rb:607
      ARCONN=oracle bin/test test/cases/autosave_association_test.rb:617
      ARCONN=oracle bin/test test/cases/autosave_association_test.rb:641
      ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:546
      ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:297
      ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:586
      ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:172
      ARCONN=oracle bin/test test/cases/associations/has_many_through_associations_test.rb:269
      ```
      82e973df
  7. 30 10月, 2017 2 次提交
  8. 28 10月, 2017 3 次提交
  9. 27 10月, 2017 5 次提交
  10. 26 10月, 2017 2 次提交
  11. 25 10月, 2017 2 次提交