なるようになるブログ

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

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

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

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

activesupport/CHANGELOG

actionpack/CHANGELOG.md

railties/CHANGELOG.md


Use literal values in assertions

activesupport/test/json/encoding_test.rbの修正です。

jsonのテストでリテラル(1.0 / 0 -> Float::INFINITY0.0 / 0 -> Float::INFINITY)を使用するよう修正しています。

が、0.0 / 0INFINITYに置き換えてるのは間違い(Float::NANが正しい)で、後ほど修正されています。


It's a NAN not Infinity

activesupport/test/json/encoding_test.rbの修正です。

先のコミットで0.0 / 0の置き換えにFloat::INFINITYを使用してしまったのを、Float::NANを使用するよう修正しています。


Fix typo in constant reference

activesupport/test/json/encoding_test.rbの修正です。

Float::NANFloat:NANにタイポしていたのを修正しています。


Minor corrections to #26905

actionview/lib/action_view/helpers/asset_url_helper.rbactionview/lib/action_view/layouts.rbのdocの修正です。

doc内のProc等幅フォントで表示する為に+で囲むよう修正、+Proc & Symbol+となっていたのを、+Proc+ and +Symbol+に修正しています。


Avoid build_preloader if preloading is not needed

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

ActiveRecord::Relation#exec_queriesで、preloadが不要な場合、build_preloaderをよばないよう修正しています。


Remove deprecated key_file_path

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

deprecatedになっていたActiveSupport::Cache::FileStore#key_file_pathメソッドを削除しています。


Remove deprecated escape_key

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

deprecatedになっていたActiveSupport::Cache::MemCacheStore#escape_keyメソッドを削除しています。


Remove deprecated set_cache_value

activesupport/lib/active_support/cache/strategy/local_cache.rbの修正です。

deprecatedになっていたActiveSupport::Cache::Strategy::LocalCache::LocalStore#set_cache_valueメソッドを削除しています。


Remove deprecated namespaced_key

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

deprecatedになっていたActiveSupport::Cache::Store#namespaced_keyメソッドを削除しています。


Remove deprecated kernel debugger file

activesupport/lib/active_support/core_ext/kernel/debugger.rbの修正です。

deprecatedになっていたdebugger.rbを削除しています。


Remove deprecated local_constants

activesupport/lib/active_support/core_ext/module/introspection.rbの修正です。

deprecatedになっていたModule.local_constantsメソッドを削除しています。


Remove deprecated module method_transplanting file

activesupport/lib/active_support/core_ext/module/method_transplanting.rbの修正です。

deprecatedになっていたmethod_transplanting.rbを削除しています。


Remove warning from access to Bignum class, 2**64 is already a known bignum value. See also http://patshaughnessy.net/2014/1/9/how-big-is-a-bignum for smallest bignum value

activesupport/test/core_ext/numeric_ext_test.rbの修正です。

Bignumクラスの値を作成する為にあった不要なループ処理を削除しています。

   b = 2**64
-  b *= b until Bignum === b

2**64の時点でBignumクラスのデータが作成されている為。

(2**64).class
# => Bignum

Remove deprecated struct core_ext file

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

deprecatedになっていたcore_ext/struct.rbを削除しています。


Remove deprecated time marshal core_ext file

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

deprecatedになっていたcore_ext/time/marshal.rbを削除しています。


Remove deprecated new_from_hash_copying_default

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

deprecatedになっていたActiveSupport::HashWithIndifferentAccess.new_from_hash_copying_defaultメソッドを削除しています。


Remove deprecated :prefix option

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

deprecatedになっていたnumber_to_human_sizeメソッドのprefixオプションを削除しています。


Update CHANGELOG

activesupport/CHANGELOG.mdの修正です。

ここまでのdeprecatedの削除対応について、まとめてentryを追加しています。


use correct value in example [ci skip]

actioncable/lib/action_cable/helpers/action_cable_helper.rbのdocの修正です。

action_cable_meta_tagメソッドのdoc内にあるexampleで、'data-turbolinks-track' => trueを指定したのですが、turbolinks 5系からはtrueではなくreloadを使用する必要がある為、その旨修正しています。


Fix NameError: undefined local variable or method result

ctiverecord/lib/active_record/connection_adapters/mysql/database_statements.rbの修正です。

executeの実行結果を格納する変数のscopeがおかしい為に、MySQL + prepared_statementsを使用している場合に、NameError(undefined local variable or method result)が発生してしまうバグがあったのを修正しています。


Call spawn and bang method for none

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

ActiveRecord::QueryMethods#noneメソッドで、独自に処理を定義していたのを、none!メソッドを呼び出すよう修正しています。

    def none
-      where("1=0").extending!(NullRelation)
+      spawn.none!
     end

他のquery methodと合わせる為、との事です。


Merge pull request #26222 from vipulnsward/26134-fix

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

DebugExceptions middleware で複数行のlogを出力する際に、1行毎にlogger.fatalを呼んでいたのを、logを1行にまとめてlogger.fatalの呼び出しを1回で済ませるよう修正しています。

      def log_array(logger, array)
-        array.map { |line| logger.fatal line }
+        if logger.formatter && logger.formatter.respond_to?(:tags_text)
+          logger.fatal array.join("\n#{logger.formatter.tags_text}")
+        else
+          logger.fatal array.join("\n")
+        end
       end

Merge pull request #27007 from maclover7/jm-fix-26912

actionpack/lib/action_dispatch/http/mime_negotiation.rbの修正です。

CONTENT_TYPEの値が空だった場合に、NoMethodErrorが発生してしまうバグがあったのを修正しています。


Remove deprecated Module.qualified_const_get/set/defined?

Active Supportの修正です。

deprecatedになっていた Module.qualified_const_defined?, Module.qualified_const_get, Module.qualified_const_setメソッドを削除しています。


Remove deprecated constant MissingSourceFIle

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

deprecatedになっていたMissingSourceFile定数を削除しています。


Add :skip_sprockets to Rails::PluginBuilder::PASSTHROUGH_OPTIONS

railties/lib/rails/generators/rails/plugin/plugin_generator.rbの修正です。

rails engineをnewする際にskip_sprocketsオプションを使用出来るようにする為に、Rails::PluginBuilder::PASSTHROUGH_OPTIONS:skip_sprocketsを追加しています。


Remove deprecated method alias_method_chain

activesupport/lib/active_support/core_ext/module/aliasing.rbの修正です。

deprecatedになっていたalias_method_chainメソッドを削除しています。


Remove deprecated method Numeric#to_formatted_s

activesupport/lib/active_support/core_ext/numeric/conversions.rbの修正です。

deprecatedになっていたNumeric#to_formatted_sメソッドを削除しています。


Remove deprecated separator argument from parameterize

activesupport/lib/active_support/core_ext/string/inflections.rbactivesupport/lib/active_support/inflector/transliterate.rbの修正です。

deprecatedになっていたparameterizeメソッドのseparator引数を削除しています。


Remove deprecated class ActiveSupport::Concurrency::Latch

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

deprecatedになっていたActiveSupport::Concurrency::Latchクラスを削除しています。