rails commit log流し読み(2019/03/12)
2019/03/12分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activemodel/CHANGELOG.md
activesupport/CHANGELOG.md
Merge pull request #35485 from excid3/default-attachable-trix-partial
actiontext/lib/action_text/attachable.rb
の修正です。
ActionText::Attachable
moduleにto_trix_content_attachment_partial_path
メソッド(Trixでattachementを表示する際に使用するメソッド)を定義し、ActionText::Attachable
をincludeしているmodelで同じpathを参照するよう修正しています。
Add locale option to parameterize
activesupport/lib/active_support/core_ext/string/inflections.rb
、
activesupport/lib/active_support/inflector/transliterate.rb
の修正です。
String#parameterize
、及び、ActiveSupport::Inflector#parameterize
、ActiveSupport::Inflector#transliterate
メソッドの引数にlocale
オプションを追加しています。これらのメソッドは最終的にI18n.transliterate
を呼ぶようになっているのですが、I18n.transliterate
では元々locale
を指定出来るようになっており、オプションをそのまま渡すようになっています。
Merge pull request #34965 from bogdanvlviv/improve-rails-encrypted--help
railties/lib/rails/commands/encrypted/USAGE
、
railties/lib/rails/commands/encrypted/encrypted_command.rb
の修正です。
encrypted
コマンド用のUSAGEファイルを追加し、encrypted
コマンドのヘルプでコマンドについての詳細を表示するよう修正しています。
[ci skip] Improve encrypted
commands USAGE
railties/lib/rails/commands/encrypted/USAGE
の修正です。
encrypted
コマンドのUSAGEにEncryption Keysについての詳細な説明を追加、及び、各箇所の言い回し等を修正しています。
Merge pull request #34955 from bogdanvlviv/follow-up-33962
Restructure credentials after environment overrides.のfollow upとして、rails guideのConfiguring Rails Applications
にconfig.credentials.content_path
、及び、config.credentials.key_path
についての説明を追加、及び、各箇所のタイポを修正しています。
Fix bug with parametrize when locale
is passed
Active Supportの修正です。
先のlocale
オプションを追加した対応で、オプションの指定方法が誤っていた箇所があったのを修正、及び、全く無かったテストを追加しています。
Do not generate dummy string when the tag used is not the <%=
railties/lib/rails/application/dummy_erb_compiler.rb
の修正です。
Load YAML for rake tasks without parsing ERBでDB用のtaskをロードする際にdatabase.yml
をERBのパース無しで読み込むようにしたのですが、それだと逆にERBを使用して動的にdatabase.yml
を生成している際に困る、という問題が発生しました。
その対応として、タグが<%=
を使用している場合のみダミー文字列を使用する(ERBのパースを行わない)よう修正を行うようにしています。
overriden -> overridden [ci skip]
railties/lib/rails/commands/encrypted/USAGE
の修正です。
overridden
をoverriden
にタイポしていたのを修正しています。
bump Zeitwerk to 1.3.3
activesupport/activesupport.gemspec
の修正です。
zeitwerkのバージョンを>= 1.3.3
に修正しています。
Merge pull request #35424 from Korri/validation-rules-locale-fallback
activemodel/lib/active_model/errors.rb
の修正です。
error messageをi18nで変換する際に、他のロケールを見るより先にgeneric messageにフォールバックしていたのを、他のロケールの値を確認するよう修正しています。
例えば、Product
modelのtitle
attributeでblank
エラーがen-US
localeで発生した場合のi18nのルックアップ処理が、以下のように変更されています。
before
en-US.activerecord.errors.models.product.attributes.title.blank
en-US.activerecord.errors.models.product.blank
en-US.activerecord.errors.messages.blank
en-US.errors.attributes.title.blank
en-US.errors.messages.blank
en.activerecord.errors.models.product.attributes.title.blank
en.activerecord.errors.models.product.blank
en.activerecord.errors.messages.blank
en.errors.attributes.title.blank
en.errors.messages.blank
after
en-US.activerecord.errors.models.product.attributes.title.blank
en-US.activerecord.errors.models.product.blank
en-US.activerecord.errors.messages.blank
en.activerecord.errors.models.product.attributes.title.blank
en.activerecord.errors.models.product.blank
en.activerecord.errors.messages.blank
en-US.errors.attributes.title.blank
en-US.errors.messages.blank
en.errors.attributes.title.blank
en.errors.messages.blank
Add changelog entry for transliterate/parameterize accepting locale
[ci skip]
activesupport/CHANGELOG.md
の修正です。
transliterate
とparameterizeで
locale`オプションを指定出来るようにした対応について、CHANGELOGにエントリーを追加しています。
Add note about has_many associations callbacks [ci skip]
rails guideのActive Record Associations
の修正です。
Association Callbacks
の項に、association callbackはassociationが追加 / 削除された時だけ実行される旨説明を追加しています。
After https://github.com/rails/rails/pull/35281 and https://github.com/rails/rails/pull/35036 AV warns about not having the compiled container.
guides/rails_guides/generator.rb
の修正です。
guideのgeneratorでtemplate cacheに関するwarningが出ていたので、with_empty_template_cache
メソッドを使用してインスタンスを生成するよう修正しています。
Show friendly message to install action mailbox if the related table does not exist
actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb
、
actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb
の修正です。
エラーページを表示する際に、エラーがAction Mailboxのテーブルが無い事によるエラーだった場合、エラーページにrails action_mailbox:install
を実行すれば解決する旨説明を記載するよう修正しています。
Add additional ERB DummyCompiler tests
railties/test/application/rake/dbs_test.rb
の修正です。
ERB DummyCompiler(database.yml
をERBのパース無しで読み込む際に使用する為のクラス)についてのテストを追加しています。
Edit a changelog entry [ci skip]
activemodel/CHANGELOG.md
の修正です。
CHANGELOG entryのグラマーの修正を行っています。
Change wording of some instances of 'opt out' [ci skip]
docの修正です。
各箇所のグラマーの修正を行っています。