2018/08/23分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activestorage/CHANGELOG.md
ActiveStorage::DiskController#show
generates a 404 Not Found response when the requested file is missing from the disk service. It previously raisedErrno::ENOENT
.ActiveStorage::Blob#download
andActiveStorage::Blob#open
raiseActiveStorage::FileNotFoundError
when the corresponding file is missing from the storage service
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
の修正です。
使用していないaccessorを削除しています。
Two fewer array allocations on action_methods
actionpack/lib/abstract_controller/base.rb
の修正です。
AbstractController::Base.action_methods
メソッドで、メソッドのリストを作成する際にArray#uniq
+ Array#map
を使用していたのを、Array#uniq!
+ Array#map!
を使用するよう修正しています。不要なArrayを生成しないようにする為。
Merge pull request #33162 from utilum/stop_using_mocha
Active Record、Active Supportの修正です。
mock処理にmocha
を使用していたのを、Minietstのmock及びRails内部のヘルパーメソッドを使用するよう修正しています
これでmocha
を使用している箇所が全てなくなり、Gemfile
からもmocha
が削除されています。
Remove rake initializers
from rake tasks list
railties/lib/rails/tasks/initializers.rake
の修正です。
deprecateになったinitializers
がrakeタスクの一覧に表示されないようにしています。
Merge pull request #33685 from krusty3002/master
rails guideのUpgrading Ruby on Rails
の修正です。
Configure Framework Defaults
の項を追加し、default configについての説明(config/initializers/new_framework_defaults.rb
ファイル、及び、config.load_defaults
メソッドについての説明)を追加しています。
Fix rails initializers --help
and rails dev:cache --help
railties/lib/rails/commands/dev/dev_command.rb
、
railties/lib/rails/commands/initializers/initializers_command.rb
の修正です。
rails initializers
、及び、rails dev:cache
コマンドのhelpが表示されるよう修正しています。
Update ParameterFilter to yield original parameters
actionpack/lib/action_dispatch/http/parameter_filter.rb
の修正です。
ActionDispatch::Http::ParameterFilter
にblockを指定した際に、blockの第三引数に元のparametersを渡すよう修正しています。
これにより、元のparametersが特定の値の時だけfilter処理を行う、というような事が出来るようになっています。
Remove extra execution of uniq!
on action_methods
actionpack/lib/abstract_controller/base.rb
の修正です。
AbstractController::Base.action_methods
メソッドから不要なuniq!
メソッドの呼び出しを削除しています。
その後の処理でto_set
メソッドを使用している為。
Include form_with in form_helpers rails guide (#33523)
rails guideのAction View Form Helpers
の修正です。
formの生成処理のexampleにform_for
、form_tag
を使用していたのを、form_with
を使用するようまとめて修正しています。
Merge pull request #33666 from cbothner/fail-gracefully-from-activestorage-file-not-found
Active Storageの修正です。
ActiveStorage::DiskController#show
で指定されたファイルが見つからなかった際に、Errno::ENOENT
をraiseしていたのを、404 Not Found responseを返すよう修正、及び、ActiveStorage::Blob#download
、ActiveStorage::Blob#open
で指定されたファイルが無かった場合に、各サービスのエラークラス(e.g. Google::Cloud::NotFoundError
、Aws::S3::Errors::NoSuchKey
)がraiseされていたのを、ActiveStorage::FileNotFoundError
をraiseするよう修正しています。
Merge pull request #32647 from eugeneius/lazy_transactions
Active Recordの修正です。
トランザクションの開始(BEGIN
)を実際にqueryが実行されるまで遅延するようにして、queryが実行されない場合は不要なトランザクションを実行しないよう修正しています。
元々は、modelのsave処理で実際はqueryが実行されない(元の状態から値が変更されていない時等)場合でもBEGIN / COMMIが実行されていましたが、この対応により、そのような場合はトランザクションが実行されないようになっています。
Use string lengths instead of regexp to extract path
actionpack/lib/action_controller/metal/helpers.rb
の修正です。
all_helpers_from_path
メソッドでpathからhelper名を取得する際に、正規表現を使ってpathから_helper.rb
を除去していたのを、_helper.rb
のsize分Stringを削るよう修正しています。
- extract = /^#{Regexp.quote(_path.to_s)}\/?(.*)_helper.rb$/ - names = Dir["#{_path}/**/*_helper.rb"].map { |file| file.sub(extract, '\1'.freeze) } + names = Dir["#{_path}/**/*_helper.rb"].map { |file| file[_path.to_s.size + 1..-"_helper.rb".size - 1] }
最初の正規表現のやり方だと、case-insensitive なファイルシステムで正しくhelper名が取得出来ない為。
activerecord/test/cases/transaction_isolation_test.rb
の修正です。
Transaction Isolationをサポートしていない場合のテストで、テスト内で使用するクラス名をタイポしている箇所があったのを修正しています。
Merge pull request #33703 from bogdanvlviv/follow-up-33659
Action Cableの修正です。
Action Cableテスト用のtest helper、及び、adapterを追加した対応のフォローアップとして、docの修正して、不足していたテストの追加等を行っています。