2014/05/13分のコミットです。
ActionDispatch::Routing::PolymorphicRoutes
に対する大量のコミットがあったのですが、リファクタリング、かつ、同じ箇所に対する修正が複数回行われており、一つ一つのコミットが確認するのは辛かったので、割愛しています。
pg, change_column_default
accepts []
. Closes #11586.
PostgresqlのConnectionAdapterに関する修正です。
change_column
のdefaultに[]
を指定出来るようになりました。
change_column :pg_arrays, :snippets, :text, array: true, default: []
こんな感じです。Postgresqlでarray
使う時ようですね。
test, use columns_hash[]
in place of columns.find {}
.
PostgresqlAdapter
のテストの修正です。
columns.find {}
でcolumnを取得していた処理を、 columns_hash
を使うように修正しています。
Use block parameter rather than $1
during gsub!
so ActiveSupport::SafeBuffer
values aren't mangled.
ActiveSupport::NumberHelper::NumberToDelimitedConverter#parts
メソッドの修正です。
number_to_delimited
メソッドが引数にActiveSupport::SafeBuffer
を指定された時に正常に動いてなかったのを修正しています。
html_safe
メソッドを使うと、戻り値はActiveSupport::SafeBuffer
になるので、html_safe
メソッドを使うケースではまずかったようです。
activesupport/test/number_helper_test.rb
の修正です。
上記コミットのテストを、ActiveSupport::SafeBuffer
のインスタンスを生成して行ってたのを、String#html_safe
メソッドを使用するようにしています。
SafeBuffer
がnon-publicなAPIだからですね。
Update and add tests in array_ext_test.rb
activesupport/test/core_ext/array_ext_test.rb
の修正です。
to_xml
メソッドにArrayを指定した場合のテストを追加しています。
Update require in array_ext_test.rb
activesupport/test/core_ext/array_ext_test.rb
の修正です。
requireするファイルを整理しています。
Hash#except is expensive and this is a hotspot, so use a dup + delete
ActionDispatch::Routing::RouteSet::Generator#url_for
の修正です。
Hash#except
メソッドを使用している箇所をdup
+ delete
メソッドに修正しています。
Hash#except is expensive
となっているので、処理的に重い、という事でしょうか。
make the module version quack the same as the instance
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
url_options
メソッドを追加して、respond_to?
で:url_options
の存在チェックをしないでよいように修正しています。
reduce conditionals in url_for
ActionDispatch::Routing::RouteSet::Generator#url_for
の修正です。
options
のチェック処理をリファクタリングしています。
typo: resulution -> resolution [ci skip]
rails guideのActive Record and PostgreSQL
のページの修正です。
typoの修正。
flip conditional to use if/else instead of unless/else
activesupport/lib/active_support/callbacks.rb
の修正です。
unless/else
を使用していた箇所をif/else
に修正しています。
可読性の向上の為、ですかね。
This model is a model so it should behaves like one
railties/test/railties/mounted_engine_test.rb
の修正です。
extend ActiveModel::Naming
していたのを、include ActiveModel::Model
に修正しています。
model
としての振る舞いを期待されていたクラスの為とのことです。
railties/test/application/configuration_test.rb
の修正です。
こちらも上のコミット同様、extend ActiveModel::Naming
していたのを、include ActiveModel::Model
に修正しています。
Test with ruby-head to make @tenderlove happy
travis.yml
の修正です。テスト対象にruby-head
を追加しています。
Ok. Enough models for today :rage:
railties/test/railties/engine_test.rb
の修正です。
extend ActiveModel::Naming
していたのを、include ActiveModel::Model
に修正するお仕事。
avoid array allocation when extracting usernames and passwords
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
不要なArrayの生成処理を削除しています。
actionview/test/activerecord/polymorphic_routes_test.rb
の修正です。
mergeミスがあったらしく、不要なテスト処理を削除しています。
Fix regression on assert_redirected_to
.
actionpack/lib/action_dispatch/testing/assertions/response.rb
の修正です
controllerが設定されてないときにassert_redirected_to
メソッドが失敗していたのを修正しています。
controllerが設定されてないときは、ActionController::Metal
のインスタンスを生成しています。
A minor stylistic fix and cleanup of mail deliveries.
actionmailer/test/log_subscriber_test.rb
の修正です。
ダブルクォーテーションをシングルコーテーションに修正、後処理にBaseMailer.deliveries.clear
追加を行っています。
Remove unnecessary setup and teardown.
actionmailer/test/mail_layout_test.rb
の修正です。
不要なsetup/teardown
を削除しています。
docs, explain usage of count
+ select
. Closes #15065. [ci skip]
ActiveRecord::Calculations#count
メソッドのdocの修正です。
not all valid +select+ expressions are valid +count+ expressions.
です。DBによって、動きが違うので、エラーになる事もある旨追加しています。
Move state restoration from setup/teardown into affected test cases.
actionmailer/test/delivery_methods_test.rb
の修正です。
状態の保存/復旧をsetup/teardown
で行うように修正しています。
Use with_translation helper to clean up I18n stored translations.
actionmailer/test/i18n_with_controller_test.rb
の修正です。
テスト用のヘルパーメソッドを作成し、処理を整理しています。
test, move all pg array tests into postgresql/array_test.rb
.
PostgresqlAdapterのテストの修正です。
Array
のテストを全てactiverecord/test/cases/adapters/postgresql/array_test.rb
に移動しています。
Simplify merge call on polymorphic helpers
actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
の修正です。
dup.merge!
していたのを、merge
に修正しています。
Dup options hash to prevent modifications
ActionView::Helpers::TranslationHelper#translate
メソッドの修正です。
引数のoptions
を最初にdup
し、dup
した値を操作するよう修正しています。
dup
しないと、元々の値を壊す可能性があるからでしょうね。
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
使わなくなったメソッドの削除。
Do not check defined?(CGI) on every call #to_query
Object#to_query
メソッドの修正です。
メソッドないで、毎回defined?(CGI)
を行っていたのですが、最初にrequire 'cgi'
するようにして、defined?(CGI)
を削除しています。
extract pg type map initialization process to TypeMapInitializer
.
activerecord/lib/active_record/connection_adapters/postgresql/oid.rb
の修正です。
pg_type
のデータからOID -> Type mappingを組み立てるためのTypeMapInitializer
クラスを作成しています。
元々はactiverecord/lib/active_record/connection_adapters/postgresql_adapter.rb
の中で行っていた処理を、別クラスに切り出したんですね。
pg, clarify default behavior for composite types.
activerecord/test/cases/adapters/postgresql/composite_test.rb
の修正です。
Postgresqlでcomposite typeを使用した際のテストケースを追加しています。