1. 28 12月, 2019 11 次提交
  2. 27 12月, 2019 9 次提交
  3. 26 12月, 2019 5 次提交
  4. 25 12月, 2019 10 次提交
    • P
      Remove accidental git merge marker [ci skip] · 1714d4ff
      Petrik de Heus 提交于
      1714d4ff
    • R
      Merge pull request #38091 from kamipo/fix_middleware_stack_proxy · 5e6c3318
      Ryuta Kamizono 提交于
      Fix Ruby 2.7 warnings on `MiddlewareStackProxy`
      5e6c3318
    • R
      `ruby2_keywords` for `method_missing` · d8de75df
      Ryuta Kamizono 提交于
      This fixes the following warnings:
      
      ```
      /rails/railties/lib/rails/railtie.rb:190: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
      /rails/railties/lib/rails/application.rb:222: warning: The called method `config_for' is defined here
      ```
      d8de75df
    • X
      removes redundant constantize call [skip ci] · e8c82b5d
      Xavier Noria 提交于
      The following loop constantizes after logging.
      e8c82b5d
    • R
    • R
      Revert "Merge pull request #37215 from utilum/avoid_test_flunking_on_warning" · 5324f2cb
      Ryuta Kamizono 提交于
      This reverts commit ed78e964, reversing
      changes made to eca6c273.
      5324f2cb
    • R
      Merge pull request #38090 from yahonda/ruby27_pg · 2b9edb77
      Ryuta Kamizono 提交于
      Use pg 1.2.0 to support Ruby 2.7
      2b9edb77
    • Y
      Use pg 1.2.0 to support Ruby 2.7 · 5f87e50a
      Yasuo Honda 提交于
      This pull request addresses 3 failures which expect no warnings. If
      these tests executed with Ruby 2.7, all of them failed due to warnings
      for tainted objects.
      
      * How to create this commit:
      
      ```
      % bundle update pg --conservative
      ```
      
      * Background for this change
      
      pg gem 1.2.0 https://rubygems.org/gems/pg/versions/1.2.0 has been released including https://github.com/ged/ruby-pg/pull/307
      to support Ruby 2.7, showing warnings for tainted objects. Refer https://bugs.ruby-lang.org/issues/16131
      
      * Steps to reproduce:
      
      ```
      % cd activerecord
      % ruby -v
      ruby 2.7.0dev (2019-12-25T06:38:55Z master 75dca097b8) [x86_64-darwin19]
      % bundle update --bundler
      
      % ARCONN=postgresql bundle exec ruby -w -Itest test/cases/adapters/postgresql/referential_integrity_test.rb -n test_does_not_print_warning_if_no_invalid_foreign_key_exception_was_raised
      % ARCONN=postgresql bundle exec ruby -w -Itest test/cases/adapters/postgresql/enum_test.rb -n test_no_oid_warning
      % ARCONN=postgresql bundle exec ruby -w -Itest test/cases/adapters/postgresql/postgresql_adapter_test.rb -n test_only_warn_on_first_encounter_of_unrecognized_oid
      ```
      
      * Actual results:
      
      ```
      % ARCONN=postgresql bundle exec ruby -w -Itest test/cases/adapters/postgresql/referential_integrity_test.rb -n test_does_not_print_warning_if_no_invalid_foreign_key_exception_was_raised
      
      Using postgresql
      /Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:919: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.
      ... snip ...
      /Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:259: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.
      F
      
      Failure:
      PostgreSQLReferentialIntegrityTest#test_does_not_print_warning_if_no_invalid_foreign_key_exception_was_raised [test/cases/adapters/postgresql/referential_integrity_test.rb:73]:
      expected no warnings but got:
      /Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:24: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.
      ... snip ...
      /Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:24: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.
      /Users/yahonda/src/github.com/yahonda/rails/activesupport/lib/active_support/core_ext/object/try.rb:15: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.
      
      rails test test/cases/adapters/postgresql/referential_integrity_test.rb:62
      
      Finished in 0.052862s, 18.9172 runs/s, 56.7515 assertions/s.
      1 runs, 3 assertions, 1 failures, 0 errors, 0 skips
      %
      ```
      
      ```
      % ARCONN=postgresql bundle exec ruby -w -Itest test/cases/adapters/postgresql/enum_test.rb -n test_no_oid_warning
      Using postgresql
      /Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:919: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.
      ... snip ...
      /Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:259: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.
      F
      
      Failure:
      PostgresqlEnumTest#test_no_oid_warning [test/cases/adapters/postgresql/enum_test.rb:76]:
      Expected "/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:24: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:24: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:100: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:100: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:106: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:24: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:24: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:24: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:24: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:24: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n" to be blank?.
      
      rails test test/cases/adapters/postgresql/enum_test.rb:72
      
      Finished in 0.059806s, 16.7207 runs/s, 16.7207 assertions/s.
      1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
      %
      ```
      
      ```
      % ARCONN=postgresql bundle exec ruby -w -Itest test/cases/adapters/postgresql/postgresql_adapter_test.rb -n test_only_warn_on_first_encounter_of_unrecognized_oid
      Using postgresql
      /Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:919: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.
      ... snip ...
      /Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:259: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.
      F
      
      Failure:
      ActiveRecord::ConnectionAdapters::PostgreSQLAdapterTest#test_only_warn_on_first_encounter_of_unrecognized_oid [test/cases/adapters/postgresql/postgresql_adapter_test.rb:372]:
      Expected /\Aunknown OID \d+: failed to recognize type of 'regclass'\. It will be treated as String\.\n\z/ to match "/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:100: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/oid/type_map_initializer.rb:20: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\nunknown OID 2205: failed to recognize type of 'regclass'. It will be treated as String.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:106: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:100: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:106: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:100: warning: rb_tainted_str_new_cstr is deprecated and will be removed in Ruby 3.2.\n/Users/yahonda/src/github.com/yahonda/rails/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb:106: warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.\n".
      
      rails test test/cases/adapters/postgresql/postgresql_adapter_test.rb:363
      
      Finished in 0.037451s, 26.7016 runs/s, 53.4031 assertions/s.
      1 runs, 2 assertions, 1 failures, 0 errors, 0 skips
      %
      ```
      5f87e50a
    • R
    • Y
      Allow AR::Enum definitions with boolean values · f4fbdb1b
      Yoshiyuki Hirano 提交于
      If `AR::Enum` is used for boolean field, it would be not expected
      behavior for us.
      
      fixes #38075
      
      Problem:
      
      In case of using boolean for enum, we can set with string (hash key)
      to instance, but we cannot set with actual value (hash value).
      
      ```ruby
      class Post < ActiveRecord::Base
        enum status: { enabled: true, disabled: false }
      end
      
      post.status = 'enabled'
      post.status # 'enabled'
      
      post.status = true
      post.status # 'enabled'
      
      post.status = 'disabled'
      post.status # 'disabled'
      
      post.status = false
      post.status # nil (This is not expected behavior)
      ```
      
      After looking into `AR::Enum::EnumType#cast`, I found that `blank?`
      method converts from false value to nil (it seems it may not intentional behavior).
      
      In this patch, I improved that if it defines enum with boolean,
      it returns reasonable behavior.
      f4fbdb1b
  5. 24 12月, 2019 4 次提交
  6. 23 12月, 2019 1 次提交