なるようになるブログ

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

rails commit log流し読み(2014/07/22)

2014/07/22分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activerecord/CHANGELOG.md


Touch option description grammatical error fixed [ci skip]

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

has_oneメソッドのdocのグラマーの修正です。


Remove the side-effects of validates_presence_of.

activerecord/test/cases/validations/presence_validation_test.rbの修正です。

test_validates_presence_doesnt_convert_to_arrayテストの修正です。

テストの中でSpeedometerクラスにvalidatorを追加していたのですが、その影響で別のテストケースがエラーになってしまっていたので、Speedometerクラスにvalidatorを追加する処理を修正しています。


docs, add example for running a single test against core adapters.

rails guideのContributing to Ruby on Railsの修正です。

単体テストのやり方を追記しています。

$ bundle exec rake TEST=test/cases/associations/has_many_associations_test.rb

Remove length limit that results failure in other tests.

activerecord/test/cases/migration_test.rbの修正です。

テスト用のカラムからlength limitを削除して、代わりにnull成約を追加しています。length limitの影響で他のテストがコケてしまった為のようです。


build fix, remove not null constraint.

再度activerecord/test/cases/migration_test.rbの修正です。

先程のコミットで追加されたnull成約を削除しています。既に使用しているカラムなので、null成約を入れる事は出来ない為との事です。


Make sure assertion passes for postgresql.

activerecord/test/cases/associations/nested_through_associations_test.rbの修正です。

test_has_many_through_has_one_through_with_has_one_source_reflection_preloadのテストでassert_no_queriesメソッドignore_none: falseオプションを設定しています。

不要なQueryの出力を抑制する為ですね。assert_no_queriesメソッドについてはこちら


Remove redundant that already happened in teardown.

activerecord/test/cases/attribute_decorators_test.rbの修正です。

重複しているreset処理を削除しています。


Allow to specify a type for foreign key column in migrations

ActiveRecordのreferenceの修正です。

マイグレーションに定義するreferencesadd_referenceに型の指定が出来るよう対応しています。

change_table :vehicle do |t|
  t.references :station, type: :uuid
end

元々はintegerしか指定出来なかったんですね。uuid使ってる時は助かります。


Fixes #16255 [ci skip]

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

bin/rails --versionrails --versionに修正しています。