2014/05/01分のコミットです。
DBにMySQLを使用し、configファイルにvariables
を指定した際に正しく設定されていなかったバグの修正が含まれています。
split nil / Hash cases in url_for
ActionView::RoutingUrlFor#url_for
メソッドの修正です。optionsがnil/Hashだった場合に同じ処理だったのですが、処理を分岐しています。
Hashの場合optionsの中身のチェック等の処理が必要ですが、nilの場合はチェック処理不要なので、分岐したようです。
Stringify variables names for mysql connections
DBにMySQLを使用し、configファイルにvariables
を指定した際に正しく設定されていなかったバグを修正しています。
production: adapter: mysql2 username: xxx password: xxx database: aod pool: 5 timeout: 5000 encoding: utf8 variables: sql_mode: 'ansi'
上記設定を記載したファイルをロードした際に、
:variables=>{"sql_mode"=>"ansi", :sql_auto_is_null=>0, :wait_timeout=>2147483, :sql_mode=>"STRICT_ALL_TABLES"}
このようにsql_mode
が2回設定されてしまい、configファイルに設定したsql_mode
が反映されないバグがありました。
configファイルに記載された値のkeyがStringで、内部で設定している値のkeyがSymbolだったのが問題なので、内部で設定している値のkeyもStringで設定するよう修正しています。
don't allocate string on hash access
ActionView::RoutingUrlFor#url_for
メソッドの修正です。 envにアクセスする際に、Stringをfreezeしています。
- if (same_origin = _routes.equal?(env["action_dispatch.routes"])) || + if (same_origin = _routes.equal?(env["action_dispatch.routes".freeze])) ||
freezeしておくとStringが再利用されて、メモリの効率がちょっと良いからですね。
do not allocate strings while creating urls
ActionController::UrlFor#url_options
メソッドの修正です。修正内容は上記コミットと同じで、Stringにfreezeを指定しています。
eliminate conditional when sending the named route method
ActionDispatch::Routing::PolymorphicRoutes#polymorphic_url
の修正です。
一つ変数を追加して、不要な判定処理を削除しています。
avoid calling extract_record multiple times
`actionpack/lib/action_dispatch/routing/polymorphic_routes.rbの修正です。
ActionDispatch::Routing::PolymorphicRoutes#routing_type
の引数にrecord
を追加して、extract_record
の呼び出しを減らすようにしています。
[skip ci] Document: required via
option in match
routing method.
ActionDispatch::Mapping::Base#root
メソッドのdocの修正です。
routingにmatch
を使用する際、via
オプションが必要になったのですが、 docにその説明が無かったので、修正してい追記しています。
Add documentation to select_tag for :selected option
actionview/lib/action_view/helpers/form_tag_helper.rb
のdocの修正です。
select_tag
の:selected
オプションについての説明が無かったので、追記してます。
Give real privacy to class methods in AR::PredicateBuilder
activerecord/lib/active_record/relation/predicate_builder.rb
の修正です。
クラスメソッドをprivate化するのに、private
メソッドを使用してしまっているのを、private_class_method
メソッドに修正しています。
前回違う箇所でも同じ修正があったので、他にもありそうですねえ。