なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2022/06/24)

2022/06/24分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activerecord/CHANGELOG.md


Require ruby-vips before downloading blob

activestorage/lib/active_storage/analyzer/image_analyzer/vips.rbの修正です。

ruby-vipsを使用するメソッドの先頭で、ruby-vips gemがインストールされているかチェックするよう修正しています。


Document that load hooks run if already triggered

activesupport/lib/active_support/lazy_load_hooks.rbのdocの修正です。

ActiveSupport::LazyLoadHooksのdocに、既に実行済みのhookをloadした場合の挙動についての説明を追加しています。


Removed docs for removed urlsafe_csrf_token config

rails guideのConfiguring Rails Applicationsの修正です。

Remove the deprecated urlsafe_csrf_tokens configurationで削除されたconfig.action_controller.urlsafe_csrf_tokens configについての説明が残っていたのを削除しています。


turbolinks:load to turbo:load in ActionCable guide

rails guideのAction Cable Overviewの修正です。

turbolinks:loadturbo:loadに修正しています。


Merge pull request #45324 from adrianna-chang-shopify/ac-migration-strategy-objects

Active Recordの修正です。

migration実行時に、任意の処理を実行出来るようにしています。通常は今までどおりadapterで定義されたmigrationメソッドが実行されるようになっていますが、config.active_record.migration_strategyにクラスが指定されている、かつ、そのクラスで実行しようとしたmigrationメソッドが定義されている場合、そちらの処理が実行されるようになっています。

class CustomMigrationStrategy < ActiveRecord::Migration::DefaultStrategy
  def drop_table(*)
    raise "Dropping tables is not supported!"
  end
end

config.active_record.migration_strategy = CustomMigrationStrategy