2015/12/28分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- When calling
first
with alimit
argument, return directly from theloaded?
records if available. - Deprecate sending the
offset
argument tofind_nth
. Please use theoffset
method on relation instead.
[ci skip] Fix typos in Active Support changelog.
activesupport/CHANGELOG.md
の修正です。
numeric
をnumberic
に、ActionController
をActiveController
にそれぞれタイポしている箇所があったのを修正しています。
Removed extra "the" in the documentation of broadcast_message
[ci skip]
activesupport/lib/active_support/logger.rb
のdocの修正です。
Logger#broadcast_messages
オプションについてのdocのグラマーの修正(不要なthe
の削除)を行っています。
tests, don't connect to mysql when running sqlite3 tests.
activerecord/test/cases/invalid_connection_test.rb
の修正です。
不正なconnectionを指定した場合のテストに、adapterがMysql2Adapter
かどうかのチェックを追加しています。
元々、mysql2 adapterでしか動かないテストになっており(テストの前処理でmysql2 adapterを決め打ちしている)、sqlite3でテストを実行した場合にエラーになってしまっていたので、チェックを追加したとの事です。
Merge pull request #22053 from Empact/first-loaded
activerecord/lib/active_record/relation/finder_methods.rb
の修正です。
二つの対応が一つのPRでまとめて行われています。
まず一つ目は、ActiveRecord::FinderMethods#first
メソッドにlimit
オプションを指定した場合、かつ、対象のレコードが既にload済みの場合に、load済みの値を返すよう改善しています。
二つ目は、ActiveRecord::FinderMethods#find_nth
メソッドにoffset
引数を渡すのがdeprecateになりました。offset
を指定したい場合、Relation#offset
メソッドの方を使ってね、との事です。