なるようになるブログ

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

rails commit log流し読み(2017/04/18)

2017/04/18分のコミットです。

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


Add (more) documentation to to_time

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

to_timeメソッドのdocにアプリで指定したtimezoneが設定された値が必要な場合、in_time_zoneメソッドを使うよう説明を追加しています。


Small docs fix

rails guideのGetting Started with Railsの修正です。

What is Rails?の項のRuby languageRuby programming languageに修正しています。


Add missing periods

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

to_timeメソッドのdocの終端にピリオドを追加しています。


Use more specific check for :format in route path

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

route pathに:format が含まれているかどうかを、より厳密にチェックするよう修正しています。

元々はpathに:formatという文字が含まれているかどうかでチェックしていたのですが、それだと/formats/:format_id/itemsというようなpathの場合に、:format_idという部分がマッチしてしまい、予期せぬ挙動となってしまう為、正規表現(%r{(?:\(\.:format\)+|\.:format|/)\Z})にマッチするかどうかで見るよう修正しています。


Fix Enumerable#sum redefined warning

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

Ruby 2.4以上でEnumerable#sumを再定義する事によるwarningが出てしまっていたので、Enumerable#sumが定義されている場合はそちらを使用するよう修正しています。