なるようになるブログ

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

rails commit log流し読み(2019/03/19)

2019/03/19分のコミットです。

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

activesupport/CHANGELOG.md


Added release notes for changes in Railties [ci skip] (#35622)

rails guideのRuby on Rails 6.0 Release Notesの修正です。

railtiesの変更点についてRelease Notesに記載しています。


Don't expose internal type_casted_binds method

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

内部でだけで使用するtype_casted_bindsメソッドの可視性をprivateに変更しています。


Extract column check in values_list

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

values_listメソッドで行っていたcolumのチェック処理を別メソッド(verify_columns_exist_for)に切り出しています。


Simplify values_list with more composition

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

他のvalues_listメソッドで行っていた処理も適切にメソッドに切り出すよう修正しています。


Merge pull request #35663 from eileencodes/fix-database-configuration-when-not-actually-a-three-tier

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

development:
  primary:
    database: "my db"
    variables:
      statement_timeout: 1000

のように、database.ymlに3階層より下の階層があった場合に、configロード時にエラーになってしまうバグがあったのを修正しています。


Fix a ContentNegotiation test description

actionpack/test/controller/new_base/content_negotiation_test.rbの修正です。

accept headerにtext/javascript及び*/*を指定 + XHRの場合のテストの、テスト名に誤りがあった(実際の結果と異なる内容を記載していた)のを修正しています。


Merge pull request #35659 from rails/fix-time-advance-with-historical-dates

activesupport/lib/active_support/core_ext/time/calculations.rbの修正です。

Time#advanceメソッドが1001-03-07より前の日付だと正しい値を返さないバグがあったのを修正しています。

# Before
Time.utc(1001, 3, 6).advance(years: -1) # => 1000-03-05 00:00:00 UTC

# After
Time.utc(1001, 3, 6).advance(years: -1) # => 1000-03-06 00:00:00 UTC

depend on Zeitwerk 1.4.0

activesupport/activesupport.gemspecactivesupport/lib/active_support/dependencies/zeitwerk_integration.rbの修正です。

Zeitwerkのバージョンを~> 1.4に修正、及び、Zeitwerk側の変更に合わせて、constantsのautoload処理の修正を行っています。


Merge pull request #35620 from RTJ/master

rails/activestorage/db/update_migrate/20180723000244_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.rbの修正です。

active_storage_attachments tableからactive_storage_blobsに外部キー制約を貼る為のmigrationファイルで、Active Storageに関するテーブルがそもそも存在するかチェックするようにして、存在しない場合は処理を行わないよう修正しています。


Merge pull request #35604 from jhawthorn/validate_mime_types

actionpack/lib/action_dispatch/http/mime_type.rbactionpack/lib/action_dispatch/testing/request_encoder.rbの修正です。

mime type構築時に、不正な値(e.g. スラッシュが無い(missingslash)、スラッシュが多すぎる(too/many/slash)、空の値)の場合、exceptionをraiseするよう修正しています。


update_at/on note for ActiveRecord::Relation.update_all (#35461)

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

update_allメソッドのdocに、callbackが実行されないので、update_at / update_on等のタイムスタンプのカラムは更新されない旨注記を追加しています。


Merge pull request #35358 from tjwallace/patch-1

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

resourcesメソッドのdocにparamオプションについての説明を追加しています。