なるようになるブログ

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

rails commit log流し読み(2016/01/19)

2016/01/19分のコミットです。

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


Merge pull request #22705 from RochesterinNYC/add-order-explanation-to-first-last-guides

rails guideのActive Record Query Interfaceの修正です。

firstメソッドlastメソッドについて説明している箇所に、orderメソッドと一緒に使用した場合の挙動の説明及びexampleを追加しています。


Association Guide replaces Order as example with Author-Book Example [ci skip]

rails guideのActive Record Associationsの修正です。

exampleコード用のクラスとしてOrderCustomerというクラスを使用していたのを、BookAuthorというクラスを使用するよう修正しています。

Orderだとorderメソッドと名前が被ってしまい良くないのでは、という事で修正したようです。


CodeStatistic will now ignore hidden files:

railties/lib/rails/code_statistics.rbの修正です。

CodeStatisticドットファイルは無視するよう修正しています。

ドットファイルがバイナリになっている事があり、バイナリファイルをパースしようとしてCodeStatisticがエラーになってしまう事があり、それを避ける為、との事です。


Don't run all tests when files end in a colon.

railties/lib/rails/test_unit/test_requirer.rbの修正です。

test runnerで、ファイル名を指定、かつ、ファイル名の末尾が":"だった場合(例:bin/rails t test/models/bunny_test.rb:)に、全テストを実行していたのをやめるよう修正しています。

行番号を指定しなかった場合に全テストを実行するのはユーザが期待する動作では無いだろう、という事で修正されたようです。今後は、"test/models/bunny_test.rb:"というファイル名のファイルのテストを実行しようとする動作となっています。そんな名前のファイルが存在しない場合は当然エラーになります。


Remove incomplete filter runs all tests in plugins.

railties/test/generators/plugin_test_runner_test.rbの修正です。

先のtest runnerによる対応で、plugins側のテストの修正が漏れていたので、追加で対応しています。


ApplicationRecord instead of ActiveRecord::Base in Association Guides [ci skip]

rails guideのActive Record Associationsの修正です。

modelの親クラスにActiveRecord::Baseを使用している箇所があったのを、ApplicationRecordを使用するよう修正しています。


Fix discrepancies in associations guide [ci skip]

rails guideのActive Record Associationsの修正です。

exampleコード用のクラスとしてOrderCustomerというクラスを使用していた箇所があったのを修正したコミット(Association Guide replaces Order as example with Author-Book Example [ci skip])で、修正漏れがあったのを対応しています。


refer to rails command instead of rake in environment error

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

db:environment:setの実行を促すエラーメッセージで、rakeコマンドを使用するようになっていたのを、railsコマンドを使用するよう修正しています。


Make text about render :html option clearer to state, text will get escaped if not marked as safe by using html_safe

rails guideのLayouts and Rendering in Railsの修正です。

Rendering HTMLの項に、html_safeメソッドを使ってエスケープしてないデータをhtmlオプションに指定した場合、自動でエスケープ処理が行われる旨説明を追加しています。


Mention that halting chain does not re-raise ActiveRecord::RecordInvalid exception as well, similar to ActiveRecord::Rollback

rails guideのActive Record Callbacksの修正です。

Halting Executionの項の注意事項につて記載している箇所で、exceptionをre-raiseしないクラスに、ActiveRecord::RecordInvalidが漏れていたので、追加しています。