なるようになるブログ

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

rails commit log流し読み(2021/10/15)

2021/10/15分のコミットです。

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

actionpack/CHANGELOG.md

activerecord/CHANGELOG.md

activemodel/CHANGELOG.md


Merge pull request #43448 from composerinteralia/stale-inversed-target

activerecord/lib/active_record/associations/association.rbactiverecord/lib/active_record/autosave_association.rbの修正です。

inversed associationで、明示的にidを変更した後も、元のassociationを参照してしまうバグがあったのを修正しています。


Fix Selenium deprecation warnings in CI.

ci/qunit-selenium-runner.rbの修正です。

Selenium 4.0でdeprecatedになった機能を使っていた箇所を修正しています。


Merge pull request #43440 from ignacio-chiazzo/wildcard-routes

Action Packの修正です。

wildcard segmentを使用している際に、複数行(改行の含む)のルートを指定出来るよう修正しています。

draw do
  get "/wildcard/*wildcard_segment", to: SimpleApp.new("foo#index"), as: :wildcard
end

url_helpers.wildcard_path(wildcard_segment: "a\nnewline")
# => /wildcard/a%0Anewline

Merge pull request #43451 from ignacio-chiazzo/ig/action_dispatch/inspector

actionpack/lib/action_dispatch/routing/inspector.rbのdocの修正です。

内部用のクラスに:nodoc:の指定を追加しています。


Add validation for ActiveRecord.default_timezone

activerecord/lib/active_record.rbの修正です。

ActiveRecord.default_timezoneに不正な値が指定された場合に、ArgumentErrorをraiseするよう修正しています。


Merge pull request #43444 from sabulikia/support-custom-csrf-strategy

actionpack/lib/action_controller/metal/request_forgery_protection.rbの修正です。

CSRFをチェックするstrategyに、独自のstrategyを定義したclassを指定出来るよう修正しています。

class CustomStrategy
  def initialize(controller)
    @controller = controller
  end

  def handle_unverified_request
    # Custom behaviour for unverfied request
  end
end

class ApplicationController < ActionController:x:Base
  protect_from_forgery with: CustomStrategy
end

Use a when clause for the Class check

actionpack/lib/action_controller/metal/request_forgery_protection.rbの修正です。

CSRFのstrategyを取得する処理で、引数がClassの場合の処理を他の引数と合わせてcase/when内で行うよう修正しています。


:scissors:

ci/qunit-selenium-runner.rbの修正です。

不要な空行を削除しています。


Merge pull request #43453 from jacobherrington/append-css-import-statement-on-action-text-install

actiontext/lib/generators/action_text/install/install_generator.rbの修正です。

Action Textのinstall処理でactiontext.cssのimport処理をcssファイルに追加するよう修正しています。


Fix the devcontainer setup to also fix the permissions of git gems

.devcontainer/boot.shの修正です。

devcontainerのsetup処理で、git経由でダウロードしたgemのパーミッションも変更するよう修正しています。


Bump dalli from 2.7.11 to 3.0.1 in Gemfile.lock

Gemfile.lockの修正です。

dalliのバージョンを3.0.1に更新しています。


Use Dalli::Protocol::Binary to address deprecataion warning

activesupport/test/cache/stores/mem_cache_store_test.rbの修正です。

deprecatedになったDalli::Serverの代わりに、Dalli::Protocol::Binaryを使用するよう修正しています。


Use Dalli::Protocol::Binary instead of deprecated Dalli::Server

activesupport/test/cache/stores/mem_cache_store_test.rbの修正です。

引き続き、deprecatedになったDalli::Serverの代わりに、Dalli::Protocol::Binaryを使用するよう修正しています。


Disable Dalli compression on the protocal level

activesupport/lib/active_support/cache/mem_cache_store.rbactivesupport/test/cache/cache_store_setting_test.rbの修正です。

Dalliのcompression処理をprotocol levelで無効化するよう修正しています。元々はwrite levelで無効化していたのですが、Dalli 3からwrite levelの設定は無視されるようになった為。


Require Dalli 3 in our test suite

Gemfileの修正です。

Dalli 3以上をテストで使用するようバージョン指定を追加しています。


Fix tests for validation of default_timezone

Active Recordのテストの修正です。

default_timezoneのテストについて、値をsingleton_classで保持するよう修正、フォーマットの修正等を行っています。


Update missing actionpack CHANGELOG entry for wildcard route fix

actionpack/CHANGELOG.mdの修正です。

wildcard segmentを使用している際に複数のルートを指定出来るようにした対応について、CHANGELOGにエントリーを追加しています。


Merge PR #40491

Active Recordの修正です。

SQL:2003で追加されたfilter句のサポートをArelに追加しています。使えるのは、PostgreSQL 9.4+とSQLite 3.30+。


Merge pull request #41934 from chriscz/bugfix/plugin-gemspec-template

railties/lib/rails/generators/rails/plugin/templates/%name%.gemspec.ttの修正です。

gem directoryでgemspec filesをロードする際に、各ファイルのディレクトリに移動してからファイルを取得するよう修正しています。

Bundlerがgem directoryではなくcurrentのファイルをロードする、というバグがある為との事です。参考: Bug: Bundler evaluates local git gem gemspec within current directory instead of gem's directory


Merge pull request #43378 from Stellenticket/set_empty_secure_password

activemodel/lib/active_model/secure_password.rbの修正です。

secure passwordを使用している場合にpasswordにnilを指定してもcacheが元の値のままになってしまっているバグがあったのを修正しています。


No need to specify webdrivers version to support selenium-webdriver 4.0.0

Gemfileの修正です。

webdrivers 4.7.0がリリースされた事により不要になったgemのバージョン指定を削除しています。