なるようになるブログ

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

rails commit log流し読み(2016/12/23)

2016/12/23分のコミットです。

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

activesupport/CHANGELOG.md


Merge pull request #27424 from utilum/fix_complex_and_rational_are_duplicable

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

Rational#duplicable?Complex#duplicable?がfalseを返すよう修正しています。それぞれdup出来ない為。


Unneeded attr_accessor with side effects

actionview/test/template/form_helper/form_with_test.rbactionview/test/template/form_helper_test.rbの修正です。

file_fieldのテストから不要なmodelに対するattr_accessorの呼び出しを削除しています。


Describe what we are protecting

コンポーネントprotectedを使用している箇所で、何故protectedを使用しるかの説明をコメントに追加しています。

Ruby 2.2以下だとprivate + attr_readerを使用すると、Rubyのwarning(warning: private attribute?)が出てしまう為protectedを使用しています。

参考:Bug #10967: Is "warning: private attribute?" wrong?


Privatize unneededly protected methods in Action View tests

Action Viewのテストで、protectedを使用しているが、protectedである必要が無いメソッドのアクセス制御をprivateに変更しています。


Privatize unneededly protected methods in Action Pack tests

Action Packのテストで、protectedを使用しているが、protectedである必要が無いメソッドのアクセス制御をprivateに変更しています。