2014/09/08分のコミットです。
CHANGELOGへの追加はありませんでした。
Convert string concatenations to substitutions
activerecord/lib/active_record/schema_dumper.rb
の修正です。
Stringの連結をする際、 "+"で連結をしていたのを、ダブルコーテーションを使う形に統一しています。
- ('add_index ' + remove_prefix_and_suffix(index.table).inspect), + "add_index #{remove_prefix_and_suffix(index.table).inspect}",
Prefer "if any?" to "unless empty?"
引き続きactiverecord/lib/active_record/schema_dumper.rb
の修正です。
"unless empty?"を"if any?"に修正しています。可読性の向上の為ですかね。
Fix warnings for undefined local variable
引き続きactiverecord/lib/active_record/schema_dumper.rb
の修正です。
未定義の変数を使用してwarningが出ていたのを修正しています。
Schema dumper: all connection adapters implement #primary_key, so rely on it exclusively
まだactiverecord/lib/active_record/schema_dumper.rb
の修正です。
primary keyを取得する為に、primary_key_for
というメソッドを作成し、そこで取得の為の処理を定義していたのですが、@connection.primary_key
で取得出来るとの事で、メソッドを削除しています。
actionpack/test/lib/controller/fake_models.rb
の修正です。
使用していないclassを削除しています。
Merge pull request #16825 from cristianbica/fix-ar-nested-arrays
activerecord/lib/active_record/relation/predicate_builder/array_handler.rb
の修正です。
4.1.x系では、User.where(id: [[1,2],3])
はUser.where(id:[1, 2, 3])
と等価だったのですが、4.2で動作しなくなってしまっていたので、動作するよ修正しています。
なお、上記のようなnested arrayはdeprecateとの事なので、今後は自分でFlattenしてあげる必要があります。
Merge pull request #16827 from kuldeepaggarwal/f-disable-migration-logging
activerecord/test/cases/ar_schema_test.rb
の修正です。
ActiveRecordのSchemaのテストの際は、マイグレーションのログを出力しないよう対応しています。