なるようになるブログ

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

rails commit log流し読み(2016/06/29)

2016/06/29分のコミットです。

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

activerecord/CHANGELOG.md


Revert "Merge pull request #25131 from javierhonduco/javierhonduco/clone_depth_to_1"

travisでgit cloneする際、depthオプションに1を指定するよう修正した、Cloning depth set to 1をrevertしています。

travisはclone出来たコミットのみbuild出来るようになっており、depthに1を指定しまうと、buildしようとしているコミットより新しいコミットがある場合に、clone出来ず、buildに失敗してしまう為、1を指定しないようにrevertしたとのことです。


Add dup leftover from 26710ab.

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

tag_optionsメソッド内のoutput変数に初期値を設定するさいに、dupした値を渡すよう修正しています。

-          output = ""
+          output = "".dup

Default to frozen string literals in TagHelper.でfrozen string literalsを使用するようになり、その対応漏れです。


Make client test run individually.

actioncable/test/client_test.rbの修正です。

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


Fix setting route's to in a scope

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

route内のscopeメソッドにtoオプションを指定するとエラーになってしまうリグレッションが発生していたのを修正しています。


Fix adding implicitly rendered template digests to ETags

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

#fresh_when#stale?でEtagを生成する際、templateオプションにfalseが指定されていた場合、Etagにtemplate digestの値を含まないよう修正しています。


- Added select tag test for verifying passing html options to f.select helper

actionview/test/template/form_options_helper_test.rbの修正です。

selectメソッドにhtml optionsを渡した場合のテストを追加しています。


Merge pull request #25364 from kamipo/fix_serialize_for_date_type

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

ActiveModel::Type::Date#serializeメソッドを追加し、castした値を返すよう修正しています。

wherefind_byにTtimeやString型の値を指定した場合に、正しく検索処理が行われないバグがあり、その対応です。


update description of test_order [ci skip]

rails guideのConfiguring Rails Applicationsの修正です。

config.active_support.test_orderの説明にデフォルト値は:sortedである旨記載があったのですが、Rails 5からデフォルト値は:randomになっている為、その旨説明を修正しています。


Remove unused ActiveRecord::Base.connection_id

Active Recordの修正です。

使用されていないActiveRecord::Base.connection_idメソッド及びActiveRecord::Base.connection_id=を削除しています。


Don't attempt to clear active connections unless we'ere connected

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

ActiveRecord::QueryCache.install_executor_hooksメソッドで、コネクションをクリアーる前に、コネクションが接続済みかどうか確認するよう修正しています。


Do not specal case inspecting associated arrays of over 10 elements, preventing infinite looping in some cases.

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

attribute_for_inspectメソッドでattributeの中身を表示する際、attributeがArray、かつ要素が11個以上あった場合に、表示する要素を10個に制限していたのを、制限しないよう修正しています。

    def attribute_for_inspect(attr_name)
       value = read_attribute(attr_name)

       if value.is_a?(String) && value.length > 50
         "#{value[0, 50]}...".inspect
       elsif value.is_a?(Date) || value.is_a?(Time)
         %("#{value.to_s(:db)}")
-      elsif value.is_a?(Array) && value.size > 10
-        inspected = value.first(10).inspect
-        %(#{inspected[0...-1]}, ...])
       else
         value.inspect
       end

この制限処理の影響で無限ループが発生してしまうケースがあった為、とのことです。