1. 12 5月, 2020 12 次提交
  2. 11 5月, 2020 5 次提交
    • J
      Optimize dangerous_attribute_method? · 0c79308d
      Jean Boussier 提交于
      Profiling our application boot shows this method at 1.3% of boot time:
      
      ```
      ActiveRecord::AttributeMethods::ClassMethods#dangerous_attribute_method? (/tmp/bundle/ruby/2.7.0/bundler/gems/rails-4919b459d946/activerecord/lib/active_record/attribute_methods.rb:100)
        samples:     5 self (0.0%)  /    866 total (1.3%)
        callers:
           866  (  100.0%)  ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods#dangerous_attribute_method?
        callees (861 total):
           861  (  100.0%)  ActiveRecord::AttributeMethods::ClassMethods#method_defined_within?
      ```
      
      [A quick benchmark](https://gist.github.com/casperisfine/0ce1161253ab643f5f15ff63e901b818) shows
      that we can make it 2 to 3 times faster by precomputing the list of
      dangerous methods, and doing a simple set lookup.
      
      Of course this isn't strictly equivalent, as it's no longer dynamic, so if you
      include a module in `AR::Base` after the list was computed, new dangerous
      methods won't be considered. But at the same time, if the list was already computed,
      it means you defined attribute methods before AR::Base was fully initialized.
      
      `dangerous_class_method?` is pretty much invisible on profiles, but
      I applied the same optimization to it for consistency's sake.
      0c79308d
    • N
      Adds a rails test:all rake task (#39221) · 94887123
      Niklas Häusele 提交于
      * Adds a rails test:all rake task
      
      This task runs all tests, including system tests.
      
      * Better placement + slight tweak of the comment
      Co-authored-by: NDavid Heinemeier Hansson <david@loudthinking.com>
      94887123
    • E
      Merge pull request #39224 from yahonda/diag_build_68962 · f834f2ae
      Eugene Kenny 提交于
      Address `InnerJoinAssociationTest#test_eager_load_with_string_joins` failure with mysql2
      f834f2ae
    • Y
      Address `InnerJoinAssociationTest#test_eager_load_with_string_joins` failure with mysql2 · 950a453d
      Yasuo Honda 提交于
      `ReadOnlyTest#test_field_named_field` performs implicit commit the transaction by `ReadOnlyTest#setup`
      because of the MySQL database behavior.
      
      This commit addresses the failure at https://buildkite.com/rails/rails/builds/68962#68213887-1cef-4f76-9c95-aebc8799c806
      Here are minimum steps to reproduce:
      
      ```ruby
      % ARCONN=mysql2 bin/test test/cases/readonly_test.rb test/cases/dirty_test.rb test/cases/associations/inner_join_association_test.rb \
      -n "/^(?:ReadOnlyTest#(?:test_has_many_with_through_is_not_implicitly_marked_readonly)|DirtyTest#(?:test_field_named_field)|InnerJoinAssociationTest#(?:test_eager_load_with_string_joins))$/" --seed 50855
      Using mysql2
      Run options: -n "/^(?:ReadOnlyTest#(?:test_has_many_with_through_is_not_implicitly_marked_readonly)|DirtyTest#(?:test_field_named_field)|InnerJoinAssociationTest#(?:test_eager_load_with_string_joins))$/" --seed 50855
      
      ..F
      
      Failure:
      InnerJoinAssociationTest#test_eager_load_with_string_joins [/Users/yahonda/src/github.com/rails/rails/activerecord/test/cases/associations/inner_join_association_test.rb:87]:
      Expected: 3
        Actual: 4
      
      bin/test test/cases/associations/inner_join_association_test.rb:82
      
      Finished in 0.114674s, 26.1611 runs/s, 26.1611 assertions/s.
      3 runs, 3 assertions, 1 failures, 0 errors, 0 skips
      ```
      
      References:
      - "13.3.3 Statements That Cause an Implicit Commit"
      https://dev.mysql.com/doc/refman/8.0/en/implicit-commit.html
      950a453d
    • J
      Merge pull request #39215 from jonathanhefner/clarify-upgrade-guide-39213 · 9af2452e
      Jonathan Hefner 提交于
      Clarify existing app behavior when being upgraded [ci skip]
      9af2452e
  3. 10 5月, 2020 18 次提交
  4. 09 5月, 2020 5 次提交