なるようになるブログ

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

rails commit log流し読み(2017/08/21)

2017/08/21分のコミットです。

CHANGELOGへの追加はありませんでした。


Don’t expose prepare_column_options

Active Recordの修正です。

ColumnDumper#prepare_column_optionsメソッドの可視性をprivateに変更しています。内部だけで使うメソッドの為。


Place update_table_definition consistently in SchemaStatements

Active Recordの修正です。

Adapterクラスに定義されていたupdate_table_definitionメソッドをSchemaStatements module配下に移動しています。 schema定義に関するメソッドだからですかね。


Prefer formatted number as schema version [ci skip]

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

ActiveRecord::Schema.defineメソッドのdoc内のexampleのversionをフォーマットした値に修正しています。

-    #   ActiveRecord::Schema.define(version: 20380119000001) do
+    #   ActiveRecord::Schema.define(version: 2038_01_19_000001) do

use formatted number as schema versionで変更された値に合わせています。


Require “active_support/core_ext/hash/compact” for compact!

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

不足していたactive_support/core_ext/hash/compactのrequireを追加しています。


freshen :expires option with duration support and add expiry metadata to cookies

actionpack/lib/action_dispatch/middleware/cookies.rbの修正です。

signed/encrypted cookies に有効期限をしめすexpiresオプションを使えるよう修正しています。

cookies[:user_name] = { value: "assain", expires: 2.hours }

上記のように指定出来るようになっています。


Add executable file activestorage/bin/test

Active Storageのtestでtest runnerを使用する為のactivestorage/bin/testを追加しています。


Rename ActiveStorage::Filename#extname to extension_with_delimiter

activestorage/app/models/active_storage/filename.rbの修正です。

ActiveStorage::Filename#extnameメソッドを#extension_with_delimiterメソッドにリネームしています。


Make restart and dev:cache tasks work when customizing pid file path

railtiesの修正です。

pidファイルのパスを変更してrails serverを起動した場合に、restart及びdev:cacheタスクが正常に動作しないバグがあったのを修正しています。


DRY

Active Storageの修正です。

content_dispositionを指定するのに、service_urlメソッドに渡すまえにfilenameを指定する必要があったのを、service_urlメソッド内でfilenameの指定を行うよう修正しています。毎回filenameの指定をしないで良いようにする為に。また、引数の順番やインデントの調整等も合わせて行っています。


Fix syntax error

activestorage/lib/active_storage/service/s3_service.rbの修正です。

Service::S3Service#urlメソッドの引数に同じkeyがあったのを、片方削除しています。


Fix tests

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

先のcontent_dispositionの対応の影響でコケていたテストがあったのを修正しています。service_urlメソッドでfilenameを指定したことにより、一部処理の結果が変わってしまった為テストがコケてしまっていました。


Update regex

activestorage/test/service/azure_storage_service_test.rbの修正です。

Azure Storageを使用した場合のsigned URLの値を確認するテストで、実際の値と期待している値が異なっていたのを修正しています。


Update result of autoload_paths in Autoloading and Reloading Constants guide [ci skip]

rails guideのAutoloading and Reloading Constantsの修正です。

autoload_pathsの項にあるActiveSupport::Dependencies.autoload_pathsの実行結果の例が実際の結果と異なっていたのを修正しています。


Update Rails on Rack guide [ci skip]

rails guideのRails on Rackの修正です。

Inspecting Middleware Stackの項にあるbin/rails middlewareの実行結果の例が実際の結果と異なっていたのを修正しています。


Prevent extra SET time zone in configure_connection (#28413)

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

PostgreSQLAdapter#configure_connectionメソッドでtime zoneの設定処理が2回行われていたのを、一度だけ行われるよう修正しています。

元々はSET timezone TO 'value'SET time zone 'value' が別の意味だった(または、別の意味だと勘違いしていた)為、それぞれのSET処理が実行されいたのですが、現状左記SET処理は同じ意味の為、SET timezone TO 'value'の方だけ実行されるようにしています。


Update generator guide [ci skip]

rails guideのCreating and Customizing Rails Generators & Templatesの修正です。

generatorの実行結果の例が実際の結果と異なっていたのを修正、https://github.com/plataformatec/deviseへのリンクがgit://github.com/plataformatec/deviseになっていたのをhttps://github.com/plataformatec/devise.gitへ修正等を行っています。


Update Contributing to Ruby on Rails guide [ci skip]

rails guideのContributing to Ruby on Railsの修正です。

contributorの数について説明している箇所をhundreds of people have contributedからthousands of people have contributedに修正しています。


Fix link Contributing Ruby on Rails [ci skip]

rails guideのContributing to Ruby on Railsの修正です。

ページ内リンクを追加、rubyonrails-core mailing-listのURLが古いURLになっていたのを修正、その他外部ページへのリンクが誤っている箇所があったのの修正等を行っています。