2014/05/04分のコミットです。
細かい修正だけで、機能追加/変更のような大きなコミットはありませんでした。
docs, restructure newly added part to includes
. [ci skip]
ActiveRecord::Associasions
のdocの修正です。説明の順番を少し入れ替えています。
Refactor test to not care about the specific result of valid?
activerecord/test/cases/associations/has_many_associations_test.rb
の修正です。
結果がtrue/false
になるテストで、assert_equal
メソッドを使っていたのを、assert/assert_not
メソッドにそれぞれ変更しています。
Remove duplicated fixture addition
activerecord/test/cases/associations/has_many_associations_test.rb
の修正です。同じfixture名が2回指定されてしまっているのを修正しています。
Reorganize ActiveRecord tasks [Arun Agrawal & Abd ar-Rahman Hamidi]
ActiveRecordの一部タスクの再編成です。
# examples # before mysql:build_databases mysql:drop_databases mysql:rebuild_databases test_mysql2 # after mysql:db:build mysql:db:drop mysql:db:rebuild test:db:mysql2
namespaceにdb
が追加された形ですね。
Revert "Merge pull request #14940 from arunagw/hbakhtiyor-test-db-namespaces-ar"
と、コミットされた上記namespaceの変更ですが、直ぐ様revertされています。
bundle exec rake test:db:postgresql
でsqlite3
のアダプターが使用されてしまっている為、との事です。
Remove tests method for test cases when controller can be inferred.
controller
系のテストコードの修正です。コードから不要なtests
メソッドを削除してます。
tests
メソッドはtest_case.rbで定義されており、test対象のcontrollerを指定する為のメソッドです。
テストクラス名とテスト対象のcontrollerが一致する場合、tests
メソッドが不要なので、削除しているですね。
Merge pull request #14959 from akshay-vishnoi/doc_changes
actionview/lib/action_view/lookup_context.rb
のdocの修正です。typo及び文法の修正です。
refactor, move column_for
to AbstractAdapter
for better reuse.
ActiveRecord::ConnectionAdapters::AbstractAdapter::AbstractMysqlAdapter
、に定義されていたcolumn_for
メソッドをAbstractAdapter
に移動しています。
他のDBのadapterでも似たよな処理を行っていたので、処理の共通化の為ですね。
Document ActionController::TestCase::Behavior#process
ActionController::TestCase::Behavior#process
のdocを追加しています。
HTTP requestをシミュレートするためのメソッドのようです。
# example: calling +create+ action & sending two params # # process :create, 'POST', user: { name: 'Gaurish Sharma', email: 'user@example.com' }
これ便利そうな。
Rails One Click is not maintained anymore [ci skip]
rails guideのGetting Startedの修正です。
メンテナンスされていないRails One Clickを削除し、代わりにTokaidoを追加しています。
Convert column name to string only once
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
の修正です。
ブロックの中で複数回行われてしまっていたto_s
メソッドを、外だしして一度だけ処理するよう修正しています。
Simplify unless conditional with OR
こちらもactiverecord/lib/active_record/connection_adapters/abstract_adapter.rb
の修正です。
不要なunless
を削除しています。
Get rid of conditional since column_for handles raising now
ActiveRecord::ConnectionAdapters::Column#rename_column_sql
メソッドの修正です。
指定されたcolumnが存在しない場合にActiveRecordErrorをraiseするようになっていたのですが、column_for
メソッドの中でraiseされるので、ここでraiseする必要な無いので、raise処理を削除しています。
Simplify building options hash in rename column method for mysql
ActiveRecord::ConnectionAdapters::Column#rename_column_sql
メソッドの修正です。
Hashの作成処理を以下のように修正しています。
# befor options = { name: new_column_name } options[:default] = column.default options[:null] = column.null options[:auto_increment] = column.extra == "auto_increment" # after options = { name: new_column_name, default: column.default, null: column.null, auto_increment: column.extra == "auto_increment" }
Use the reader attribute rather than the instance var when possible
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
の修正です。
インスタンス変数を参照している箇所を、アクセサメソッドを使用する修正しています。
これ何ででしょう。アクセサメソッドの方が効率良いとか、あったかな。
Fix examples indent and improve #process docs a bit [ci skip]
ActionController::TestCase::Behavior#process
のdocのインデント及び改行等を修正しています。