なるようになるブログ

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

rails commit log流し読み(2022/05/19)

2022/05/19分のコミットです。

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

activemodel/CHANGELOG.md

actionpack/CHANGELOG.md

railties/CHANGELOG.md


Make validators accept lambdas without record argument

Active Modelの修正です。

validatorの引数のlambdaをrecord引数無しで指定出来るよう修正しています。

validates_comparison_of :birth_date, less_than_or_equal_to: -> { Date.today }

Fix using helpers in content_security_policy and permissions_policy

actionpack/lib/action_controller/metal/content_security_policy.rbactionpack/lib/action_controller/metal/permissions_policy.rbの修正です。

content_security_policypermissions_policyでhelperで定義したメソッドを使用出来るよう修正しています。

module ApplicationHelper
  def pigs_can_fly?
    false
  end
end

content_security_policy do |p|
  p.default_src "https://example.com"
  p.style_src "https://example.com" unless helpers.pigs_can_fly?
end

Update primary key for dl_keyed_join

activerecord/test/models/destroy_async_parent.rbの修正です。

テストで使用するassociationのprimary keyの指定が誤っていたのを修正しています。


Improve prefixing routes example in guides [ci-skip]

rails guideのRails Routing from the Outside Inの修正です。

Prefixing the Named Route Helpersの項にある:asオプションを指定した場合の詳細な挙動についての説明を追加しています。


Upgrade bundler version

Gemfile.lockの修正です。

bundlerのバージョンを更新しています。


Upgrade Release guide to match current practices

RELEASING_RAILS.mdの修正です。

各種リリース処理に関する説明を、最新の対応内容に合わせて修正しています。


Support declarative-style test name filters

railties/lib/rails/test_unit/runner.rbの修正です。

bin/rails testでdeclared nameによるテストのフィルターを指定出来るよう修正しています。