- 28 12月, 2019 11 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
We don't do anything with it, so even if the user pass it no warning is print
-
由 Rafael França 提交于
Remove reference to global rails command in the docs
-
由 Rafael Mendonça França 提交于
-
由 Haroon Ahmed 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael França 提交于
Switch to standardized argument name
-
由 Rafael Mendonça França 提交于
We only need to call this method once.
-
由 Jared Fine 提交于
-
- 27 12月, 2019 9 次提交
-
-
由 Rafael França 提交于
Allow AR::Enum definitions with boolean values
-
由 Rafael Mendonça França 提交于
Ruby 2.7 is not available yet.
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael França 提交于
Document how to add session middleware to an API app
-
由 Ryuta Kamizono 提交于
Clear callback triggers when transaction completes
-
由 Yoshiyuki Hirano 提交于
This commit will be squished into f4fbdb1b after maintainer's review.
-
由 Eugene Kenny 提交于
The `_trigger_update_callback` and `_trigger_destroy_callback` attributes were added in 9252da96 to avoid running transactional callbacks when an attempt to modify a record fails inside a transaction due to the record being invalid, for example. However the values weren't being reset between transactions, which meant they leaked from one transaction to another and caused false positives where unsuccessful modifications still triggered callbacks. Clearing them when a transaction commits or is rolled back fixes the problem.
-
由 Uģis Ozols 提交于
-
- 26 12月, 2019 5 次提交
-
-
由 Joe Marty 提交于
Addresses some comments in original PR for docs on using session management middleware in API apps
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
- 25 12月, 2019 10 次提交
-
-
由 Petrik de Heus 提交于
-
由 Ryuta Kamizono 提交于
Fix Ruby 2.7 warnings on `MiddlewareStackProxy`
-
由 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 ```
-
由 Xavier Noria 提交于
The following loop constantizes after logging.
-
由 Ryuta Kamizono 提交于
Especially this is caused on `config.app_middleware.insert_after` in our code base: https://github.com/rails/rails/blob/2b9edb777b2a9567eac8e79e5dc44ce2ef28fe23/activerecord/lib/active_record/railtie.rb#L88-L90 https://github.com/rails/rails/blob/2b9edb777b2a9567eac8e79e5dc44ce2ef28fe23/activerecord/lib/active_record/migration.rb#L556-L557
-
由 Ryuta Kamizono 提交于
This reverts commit ed78e964, reversing changes made to eca6c273.
-
由 Ryuta Kamizono 提交于
Use pg 1.2.0 to support Ruby 2.7
-
由 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 % ```
-
由 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.
-
- 24 12月, 2019 4 次提交
-
-
由 y-yagi 提交于
Use the single line editor in console test
-
由 yuuji.yaginuma 提交于
It's a bit difficult to deal properly with IRB's multi line and color, and I think we don't need to check it out in `rails console` tests.
-
由 Ryuta Kamizono 提交于
Fix keyward arguments warning in `MiddlewareStack#build`
-
由 y-yagi 提交于
Make `LoadInterlockAwareMonitor` work in Ruby 2.7
-
- 23 12月, 2019 1 次提交
-
-
由 Ryuta Kamizono 提交于
This is an alternative of 6b633a28. `ActionDispatch::Static` middleware requires to be passed `**kwargs`. https://github.com/rails/rails/blob/0b3c710d35199d187dbfddaefbb9ab2752ea6498/railties/lib/rails/application/default_middleware_stack.rb#L27 https://github.com/rails/rails/blob/0b3c710d35199d187dbfddaefbb9ab2752ea6498/actionpack/lib/action_dispatch/middleware/static.rb#L112-L116 But `ActionDispatch::Session::CookieStore` middleware requires to be passed actual `session_options` to `options.merge!(cookie_only: true)` destructively. (Ideally passed args should not be mutated, but for now the middleware intentionally murate the args and testing that.) https://github.com/rails/rails/blob/0b3c710d35199d187dbfddaefbb9ab2752ea6498/railties/lib/rails/application/default_middleware_stack.rb#L65 https://github.com/rails/rails/blob/0b3c710d35199d187dbfddaefbb9ab2752ea6498/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb#L59-L61 https://github.com/rails/rails/blob/0b3c710d35199d187dbfddaefbb9ab2752ea6498/railties/test/application/configuration_test.rb#L1557-L1563 https://github.com/rails/rails/blob/0b3c710d35199d187dbfddaefbb9ab2752ea6498/railties/test/application/middleware/session_test.rb#L337-L341 To address both case, we need to evaluate args for building app in the `use` method context (that method args in the context have last args whether kwargs or hash).
-