2019/03/30分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activemodel/CHANGELOG.md
Action Pack、Action Viewの修正です。
annotated
をannoted
にタイポしていたのを修正しています。
Rename i18n_full_message
config option to i18n_customize_full_message
Active Modelの修正です。
ActiveModel::Errors#full_message
メソッドで出力エラーのフォーマットを変更するかどうかのconfig名を、i18n_full_message
からi18n_customize_full_message
に変更しています。i18n_customize_full_message
の方が意図がわかりやすいだろう、との事です。
Add Active Model release notes for Rails 6 [ci skip] (#35790)
rails guideのUpgrading to Rails 6.0
の修正です。
Active ModelのNotable changes
を追加しています。
Merge pull request #35781 from excid3/rich_text-field-generator
railtiesの修正です。
model generatorにrich_text
fieldを指定出来るよう修正しています。rich_text
fieldを指定すると、has_rich_text
が指定されたmodelが生成されるようになっています。
$ ./bin/rails g model message content:rich_text invoke active_record create db/migrate/20190329223453_create_messages.rb create app/models/message.rb invoke test_unit create test/models/message_test.rb create test/fixtures/messages.yml $ cat app/models/message.rb class Message < ApplicationRecord has_rich_text :content end
Fixed the test description for i18n-customize-full-message after rename in #35789
activemodel/test/cases/railtie_test.rb
の修正です。
Rename i18n_full_message
config option to i18n_customize_full_message
の変更に合わせて、テスト名もi18n full message
からi18n customize full message
に修正しています。
Type cast falsy boolean symbols on boolean attribute as false
activemodel/lib/active_model/type/boolean.rb
の修正です。
booleanとして扱う値にSymbol(:false
、:FALSE
等)も含むよう修正しています。
元々Symbolは含まれてfalse, 0とStringの値だけでした。ただ、query実行時にboolean attributeのcast処理を行うようにした、Ensure casting by boolean attribute when queryingの影響で、PostgreSQLで元々動作していたSymbolの値を指定してのqueryの実行(e.g. where(value: :false)
)が正しく動作しなくなりました(:false
がTRUEとして扱われる為)。
Symbolを指定するのはただの開発者の指定ミス(ユーザが入力した値はStringになるのでSymbolで値が指定される事は無い)なのですが、:false
がTRUEと判定されてしまうのは望ましい挙動では無いだろう、という事でSymbolの値もbooleanとして扱うよう修正しています。
Add ActiveRecord::Relation#extract_associated
for extracting associated record (#35784)
activerecord/lib/active_record/querying.rb
、
activerecord/lib/active_record/relation/query_methods.rb
の修正です。
relationからassociationのrecordを抽出する為のActiveRecord::Relation#extract_associated
メソッドを追加しています。
account.memberships.extract_associated(:user) # => user recordのcollectionが取得出来る # => `account.memberships.preload(:user).collect(&:user)` のショートハンド
[ci skip] Updated docs to reflect index: true option not available as column modifier
rails guideのActive Record Migrations
の修正です。
Column Modifiers
の項に、change_column
、add_column
に指定出来ないオプションについての説明があったのを削除しています。
[ci skip] Add ActiveRecord::Relation#extract_associated method to the active_record_querying.md
rails guideのActive Record Query Interface
の修正です。
Retrieving Objects from the Database
の項にあるfinderメソッドの一覧にextract_associated
メソッドを追加しています。
fixes eager loading edge case in :zeitwerk mode
Active Supportの修正です。
autoloaderにzeitwerk
を使用している場合に、config.autoload_paths
に指定されている、かつ、config.eager_load_paths
に指定されていないディレクトリがeager loadの対象になってしまうバグがあったのを修正しています。
optimizes eager loading in :zeitwerk mode
railties/lib/rails/engine.rb
の修正です。
autoloaderにzeitwerk
を使用している場合に、engineのeager loadは行わないよう修正しています。
初期化処理でengineのeager load pathsはActiveSupport::Dependencies.autoload_paths
にシフトされており、この時点でeager load pathsは空になっている為。
[ci skip] Fix typo directores -> directories
railties/test/application/zeitwerk_integration_test.rb
の修正です。
directories
をdirectores
にタイポしていたのを修正しています。
Specify Active Storage's dependency on Active Job
activestorage/activestorage.gemspec
の修正です。
Active StorageのdependencyにActive Jobを追加しています。Active Storageの中でActive Jobを使用している為。
Require railties for all Active Storage dependencies
activestorage/lib/active_storage/engine.rb
の修正です。
依存しているなライブラリのrailtie
を最初に読み込むよう修正しています。