2021/11/20分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Rollback transactions when the block returns earlier than expected.
- Remove deprecated
DatabaseConfig#config
method - Remove deprecated rake tasks:
- Remove deprecated support to
Model.reorder(nil).first
to search using non-deterministic order. - Merging conditions on the same column no longer maintain both conditions, and will be consistently replaced by the latter condition.
- Remove deprecated
Tasks::DatabaseTasks.spec
. - Remove deprecated
Tasks::DatabaseTasks.current_config
. - Deprecate
Tasks::DatabaseTasks.schema_file_type
. - Remove deprecated
Tasks::DatabaseTasks.dump_filename
. - Remove deprecated
Tasks::DatabaseTasks.schema_file
. - Remove deprecated
environment
andname
arguments fromTasks::DatabaseTasks.schema_up_to_date?
- Filter attributes in SQL logs
- Remove deprecated
ActiveRecord::Base.connection_config
- Remove deprecated
ActiveRecord::Base.arel_attribute
- Remove deprecated
ActiveRecord::Base.configurations.default_hash
. - Remove deprecated
ActiveRecord::Base.configurations.to_h
- Remove deprecated
ActiveRecord::Result#map!
andActiveRecord::Result#collect!
- Remove deprecated
config.active_support.use_sha1_digests
- Remove deprecated
URI.parser
- Remove deprecated support to use
Range#include?
to check the inclusion of a value in a date time range is deprecated - Remove deprecate
ActiveSupport::Multibyte::Unicode.default_normalization_form
- Remove deprecated
:return_false_on_aborted_enqueue
option
Merge pull request #43625 from Shopify/error-reporting-api
Active Support、railtiesの修正です。
error reporting処理の為のActiveSupport::ErrorReporter
classを追加しています。Railsのerror reporting処理がRailsの中で統一されてなくて、それを統一する為の対応。
ActiveSupport::ErrorReporter
にはerror発生時に処理をおこなう為のsubscriberを登録する事ができるようになっています。また、subscriberはreport(Exception, handled: Boolean, context: Hash)
メソッドが定義されている必要がります。
ActiveSupport::ErrorReporter
はerrorが発生した際に、subscriberを呼び出しで処理を継続するhandle
メソッドと、subscriberを呼び出して処理を停止するrecord
メソッドがそれぞれpublic APIとして提供されています。また、ActiveSupport::ErrorReporter
はshort handとして、Rails.error
で使用出来るようになっています。
Rollback transactions when the block returns earlier than expected
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
の修正です。
deprecatedになっていた、transaction block内でreturn
、break
、throw
を使用した場合、transactionがcommitされて終了する、という振る舞いを削除しています。今後は、rollbackされるようになります。
Remove deprecated DatabaseConfig#config
method
activerecord/lib/active_record/database_configurations/database_config.rb
、
activerecord/lib/active_record/database_configurations/hash_config.rb
の修正です。
deprecatedになっていたDatabaseConfig#config
メソッドを削除しています。
Remove deprecated rake tasks:
activerecord/lib/active_record/railties/databases.rake
の修正です。
deprecatedになっていたdb:xx
等のrake taskを削除しています。
Remove deprecation for aggregations that are grouping in duplicated fields
activerecord/lib/active_record/relation/calculations.rb
の修正です。
deprecatedになっていた、aggregations + groupした場合に同じfieldsが複数生成されてしまう、という挙動を削除しています。
Remove deprecated support to Model.reorder(nil).first
to search using non-deterministic order.
activerecord/lib/active_record/relation/finder_methods.rb
、
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
deprecatedになっていた、reorder(nil)
+ first
/ first!
を使用した場合に実行されるSQLにORDER
が指定されない、という挙動が削除されました。今後はreorder(nil)
が指定されていてもORDER
が指定されるようなっています。
Remove code duplication by moving logic to check_if_method_has_arguments!
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
重複して行われていたargsの展開・空の値の削除処理を削除しています。
Remove deprecation for duplicated query annotations
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
deprecatedになっていた、aggregations + annotateした場合に同じfieldsが複数生成されてしまう、という挙動を削除しています。
Change how Merging conditions on the same column works
activerecord/lib/active_record/relation/where_clause.rb
の修正です。
deprecatedになっていた、同じカラムに対するmergeで両方の条件を保持する、という挙動を削除して、後者の条件で処理が行われるようにしています。
# Rails 6.1 Author.where(id: [david.id, mary.id]).merge(Author.where(id: bob)) # => [bob] Author.where(id: david.id..mary.id).merge(Author.where(id: bob)) # => [] Author.where(id: david.id..mary.id).merge(Author.where(id: bob), rewhere: true) # => [bob] # Rails 7.0 Author.where(id: [david.id, mary.id]).merge(Author.where(id: bob)) # => [bob] Author.where(id: david.id..mary.id).merge(Author.where(id: bob)) # => [bob]
Remove deprecated environment
and name
arguments from Tasks::DatabaseTasks.schema_up_to_date?
activerecord/lib/active_record/tasks/database_tasks.rb
の修正です。
deprecatedになっていた、Tasks::DatabaseTasks.schema_up_to_date?
のenvironment
とname
引数を削除しています。
Remove deprecated methods in `Tasks::DatabaseTasks
activerecord/lib/active_record/tasks/database_tasks.rb
の修正です。
deprecatedになっていたTask::DatabaseTasks
の各メソッドを削除しています。合わせて、使われなくなったTasks::DatabaseTasks.schema_file_type
をdeprecateにしています。
Remove deprecated config.active_support.use_sha1_digests
activesupport/lib/active_support/railtie.rb
の修正です。
deprecatedになっていたconfg.active_support.use_sha1_digests
を削除しています。
activesupport/lib/active_support/core_ext.rb
、
activesupport/lib/active_support/core_ext/uri.rb
の修正です。
deprecatedになっていたURI.parser
を削除しています。
activesupport/lib/active_support/core_ext/range/include_time_with_zone.rb
の修正です。
deprecatedになっていた、Range#include?
でのdate time rangeに値が含まれているかをチェックする挙動を削除しています。
Merge pull request #43421 from seanpdoyle/action-view-unify-form-implementation
actionview/lib/action_view/helpers/form_helper.rb
の修正です。
form_for
メソッドでform_with
を再利用するよう修正しています。
activerecord/lib/active_record/log_subscriber.rb
の修正です。
ActiveRecord::Base.filter_attributes
で指定されたattributeについて、SQL queryのlogでもfilter処理が行われるようする修正しています。
# Before: # => Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."passw" = ? LIMIT ? [["passw", "hello"], ["LIMIT", 1]] # After: # => Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."passw" = ? LIMIT ? [["passw", "[FILTERED]"], ["LIMIT", 1]]
Merge pull request #43045 from sandip-mane/array-syntax-consistancy
activestorage/db/migrate/20170806125915_create_active_storage_tables.rb
の修正です。
Arrayの指定方法に、他の箇所と合わせるよう修正しています。
Remove deprecate ActiveSupport::Multibyte::Unicode.default_normalization_form
activesupport/lib/active_support/multibyte/unicode.rb
の修正です。
deprecatedになっていたActiveSupport::Multibyte::Unicode.default_normalization_form
を削除しています。
Remove deprecated :return_false_on_aborted_enqueue
option
activejob/lib/active_job/callbacks.rb
の修正です。
deprecatedになっていたActiveJob.return_false_on_aborted_enqueue
を削除しています。
activemodel/test/cases/errors_test.rb
の修正です。
重複していたテストを削除しています。
Remove deprecated ActiveRecord::Base.connection_config
activerecord/lib/active_record/connection_handling.rb
の修正です。
deprecatedになっていたActiveRecord::Base.connection_config
を削除しています。
Remove deprecated ActiveRecord::Base.arel_attribute
activerecord/lib/active_record/core.rb
の修正です。
deprecatedになっていたActiveRecord::Base.arel_attribute
を削除しています。
Remove deprecated ActiveRecord::Base.configurations.default_hash
.
activerecord/lib/active_record/database_configurations.rb
の修正です。
deprecatedになっていたActiveRecord::Base.configurations.default_hash
を削除しています。
Remove deprecated ActiveRecord::Base.configurations.to_h
activerecord/lib/active_record/database_configurations.rb
の修正です。
deprecatedになっていたActiveRecord::Base.configurations.to_h
を削除しています。
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
の修正です。
because
をbecase
にタイポしていたのを修正しています。
Remove deprecated ActiveRecord::Result#map!
and ActiveRecord::Result#collect!
activerecord/lib/active_record/result.rb
の修正です。
deprecatedになっていたActiveRecord::Result#map!
とActiveRecord::Result#collect!
を削除しています。
Merge pull request #43675 from esparta/fix_race_conditions_test_cache_ii
activesupport/test/cache/behaviors/cache_store_behavior.rb
、
activesupport/test/cache/behaviors/cache_store_version_behavior.rb
の修正です。
Active Supportのcacheのテストで、異なるテストで同じkeyを使っていた為に並列に実行するとランダムにfailしてしまっていたのを、keyにランダムな値を使用するようにして、並列に実行してもfailしないよう修正しています。
activerecord/lib/active_record/encryption/encrypted_attribute_type.rb
のdocの修正です。
EncryptedAttributeType#initialize
メソッドのdoc内のタイポを修正しています。