なるようになるブログ

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

rails commit log流し読み(2014/04/13)

2014/04/13分のコミットです。1日遅れてた分はこれで解消。

64-bit Windows MinGWZInfo::DataSourceNotFoundのエラーが発生する対応が行われています。関係無いですが、Windowsrails使われている方って、どれくらいいるんでしょうか。中々いばらそうな。


remove branching logic from calls to find_nth

find_nthを呼び出す際の分岐処理をメソッドに切り出しています。

nthって"n番目の、n倍の"という意味の単語なんですねえ。ActiveRecordfirst/second/last等を呼び出した際に使用されています。


only add the offset and index when we need to

上のコミットと同じく、activerecord/lib/active_record/relation/finder_methods.rbの修正。find_nthの第一引数をindexに修正しています。

このコミット見て気付いたのですが、forty_twoがあるんですねfifthの次がforty_twoなのは何でだろう。


don't bother with an offset if the offset is zero

上のコミットの続き。find_nth_with_limitでoffsetが0の場合にoffsetを設定しないように修正。

このコミットと直接は関係無いのですが、ActiveRecordfirst/lastにlimitを指定出来る事を初めて知りました。

Person.first(10)

とすると、先頭から10件指定出来るんですねえ。


Bundle tzinfo-data on :x64_mingw (64-bit Ruby on Windows).

Gemfileのテンプレートの修正。 tzinfo_dataのplatformx64_mingwを追加しています。

tzinfo_data自体がWindowsの場合のみinstallされるものですね。

因みに、これがないとZInfo::DataSourceNotFoundが発生してしまい、64-bit Windows MinGW builds of Rubyrails 4.1が動かないようです(Gemfieにtzinfo追記すればOK)。


Fix a few typos [ci skip]

rails guideの修正。typoの修正のみ。


CollectionHelpers now accepts a readonly option

default_html_options_for_collectionreadonlyオプションを受け付けるようになりました。

これにより、radio_box/check_box も、readonlyを設定出来るようになります。

とする事で、 readonly="readonly"にする事が出来るようになります。

なんですが、radio/checkboxって、readonly意味が無かった気が…。ブラウザ依存だったかな…。


Missing 'are' in note - [ci skip]

rails guideの修正。'are'が無かったのを修正。


Move tests for deep_dup and duplicable to object directory deep_dupとduplicableのテストファイルをactivesupport/test/core_ext/object配下に移動しています。

libの方もobject配下にあるのでパスを合わせた形。


Add a changelog entry for #14546 [ci skip]

changelogの修正。delete_allの挙動変更について追記しています。


Update documentation to use Rails.application instead

rails guide及びコメントの修正。

rails4.1からアプリケーション名がYourApp::ApplicationからRails.applicationに変更になったので、ドキュメントもRails.applicationに修正しています。