なるようになるブログ

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

rails commit log流し読み(2016/11/25)

2016/11/25分のコミットです。

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

activemodel/CHANGELOG.md


Remove blank else block

activerecord/test/cases/adapters/postgresql/uuid_test.rbの修正です。

処理が何も書かれていないelse分岐があったのを削除しています。


Suppress migration message in the test

activerecord/test/cases/adapters/postgresql/uuid_test.rbの修正です。

uuid型のテストでmigrationのログが出ないよう、ActiveRecord::Migration.verboseにfalseを設定するよう修正しています。


Should test test_change_column_default in PostgresqlUUIDTest

activerecord/test/cases/adapters/postgresql/uuid_test.rbの修正です。

gen_random_uuid関数が使用出来る場合に、defaultを変更した場合のテストを行ってなかったのを、gen_random_uuid関数が使用出来る場合もテストを実施するよう修正しています。


Fix warning: method redefined; discarding old fields

actionview/lib/action_view/helpers/form_helper.rbの修正です。

Add form_with to unify form_tag/form_for.の対応の影響でfieldsメソッドが複数回定義されてしまっていたのを、一度だけ定義されるよう修正しています。


Fix require_dependency message format

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

require_dependencyメソッドでファイルのrequireに失敗した場合のメッセージに拡張子(.rb)を追加しています。

-      def require_dependency(file_name, message = "No such file to load -- %s")
+      def require_dependency(file_name, message = "No such file to load -- %s.rb")

depend_onメソッドでは拡張子を出力するようにしており、メッセージのフォーマットを合わせる為とのことです。


Merge pull request #26874 from tgxworld/fix_broadcast_logger

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

Broadcast#silenceメソッドで親クラスのsilenceメソッドを呼び出す際に、親クラスにsilenceメソッドが定義されているかどうかをチェックするよう修正しています。

-              if respond_to?(:silence)
+              if defined?(super)
                 super(level, &block)

Merge pull request #27165 from prathamesh-sonpatki/followup-uuid-extension-change

activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rbのdoc及びrails guideのActive Record and PostgreSQLの修正です。

uuidを生成するのにgen_random_uuid()をデフォルトで使う事になった旨guideを修正、及びpostgresql 9.3以下の場合はuuid_generate_v4()が使われる旨docに説明を追加しています。


Merge pull request #23675 from kachick/activemodel-errors-indifferent

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

ActiveModel::Errors#include?#has_key?#key?#delete#full_messages_forメソッドでattributeの指定にStringを使用出来るよう修正しています。

元々はSymbolしか指定出来なかったのですが、ActiveModel::Errorsのその他のメソッドはSymbol、String両方で指定出来るようになっており、挙動を合わせる為上記メソッドもStringでattributeを指定出来るようにしたとの事です。


Merge pull request #27140 from supercaracal/fix-force-ssl-if-session-store-disabled

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

session_storeをdisableにしている、かつforce_sslを使用していた場合に、sslページヘのリダイレクト処理(#force_ssl_redirect)でエラーになってしまうバグがあったのを修正しています。


We're not calling hooks here since 9e4c41c903e8e58721f2c41776a8c60ddba7a0a9

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

使用していないactive_support/lazy_load_hooksのrequireを削除しています。