2018/09/17分のコミットです。
CHANGELOGへの追加はありませんでした。
Raise ActiveRecord::InvalidForeignKey
in before_destroy
for a blob if attachments exist
activestorage/app/models/active_storage/blob.rb
の修正です。
blobの削除前にattachmentsが存在するかチェックして、attachmentsがある場合ActiveRecord::InvalidForeignKey
をraiseするよう修正しています。
Add a foreign-key constraint to the active_storage_attachments table for blobsでactive_storage_attachments
からblobに外部キー制約を追加し、新規に作成されたアプリではこの問題が起きないようになっていますが、外部キー制約が設定されていないアプリケーションでも誤ってデータが削除されるのを防ぐために、この対応を行っています。
Merge pull request #33188 from larskanis/pg-1.1
activerecord/lib/active_record/connection_adapters/postgresql/oid/array.rb
、
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
の修正です。
pg
gemの1.1対応として、deprecateになった処理の修正、及び、exceptionをraiseするようになったメソッド向けに例外処理を追加を行っています。
Print correct rake command on running AJ integration tests
activejob/test/support/integration/helper.rb
の修正です。
Active Jobのテスト実行時に表示するテストのタスク名が実際のタスク名と異なっていたのを修正しています。
Improve readability in form helpers guide [ci skip]
rails guideのAction View Form Helpers
の修正です。
exampleコード内の、erbの閉じタグの前にスペースを追加しています。
Remove meaningless ActiveRecord::MigrationContext.new(old_path)
in ensure block
activerecord/test/cases/migration_test.rb
の修正です。
テストの後処理で元のmigration pathを引数にActiveRecord::MigrationContext.new
を呼び出していたのを削除しています。ActiveRecord::MigrationContext.new
はただActiveRecord:::MigrationContext
のインスタンスを生成するだけで副作用はなく、後処理で行う意味が無いため。
Merge pull request #33902 from bogdanvlviv/related-to-31727
activerecord/lib/active_record/migration.rb
の修正です。
ActiveRecord::Migrator.migrations_path=
メソッドを使用した際に出力deprecation message内で、メソッド名をバッククォートで囲むよう修正しています。