2015/05/05分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Handle raise flag in translate when both main and default translation is missing. Fixes #19967
- Remove :rescue_format option for translate helper since it's no longer supported by I18n.
deep_dup method, remove old key from duplicated hash to avoid unnecessary pairs
activesupport/lib/active_support/core_ext/object/deep_dup.rb
の修正です。
Keyにクラスを使用しているHash
でdeep_dup
メソッドを呼び出した際、不要なHash
が生成されてしまうバグがあったのを修正しています。
# before {Fixnum => 1}.deep_dup # => {Fixnum=>1, #<Class:0x007fc756893350>=>1} # after {Fixnum => 1}.deep_dup # => {#<Class:0x007f7c0c594b08>=>1}
Merge pull request #17632 from eugeneius/schema_cache_dump_connection_pool
ActiveRecordの修正です。
db:schema:cache:dump
タスクで生成したschemaファイル(db/schema_cache.dump
)が存在する場合に、コネクション生成時にschemaファイルから情報を取得するよう修正しています。 DBからスキーマ情報取得しないので、rails applicationの起動がちょっと高速化するとの事です。
Document inline image mailer preview interceptor
ActionMailerの修正です。
メールへの埋め込み画像をmailer previewで確認出来るようにするためのInlineAttachments
クラスを、actionmailer/lib/action_mailer/preview.rb
内に定義していたのを別ファイルに切り出し、及びクラス名をInlinePreviewInterceptor
に変更、及びdocの追加を行っています。
Handle raise flag in translate when both main and default translation is missing. Fixes #19967
actionview/lib/action_view/helpers/translation_helper.rb
の修正です。
translate
メソッドでraise
オプションがfalse
にも関わらず、default
オプションに指定したkeyの値が存在しない場合、MissingTranslationData
がraiseしてしまうバグがあったのを修正しています。
Put the assertion arguments in the right order
activesupport/test/core_ext/object/deep_dup_test.rb
の修正です。
deep_dup
メソッドのテストで、assert_equal
メソッドの引数が逆(actual、expectedの順になっていた)になっていたのを修正しています。
Remove :rescue_format option for translate helper since it's no longer supported by I18n.
actionview/lib/action_view/helpers/translation_helper.rb
の修正です。
translate
メソッドからrescue_format
オプションを削除しています。I18n
gemの方でもうサポートされなくなった為との事です。 i18n/CHANGELOG.md at masterを見る限り、0.7.0から使えなくなったようです。
Fix URI.escape is obsolete warnings
railties/lib/rails/info_controller.rb
の修正です。
deprecateになっているURI.escape
メソッドの代わりに、URI.parser.escape
メソッドを使用するよう修正しています。
Fix constant in void context warnings
railties/test/application/loading_test.rb
の修正です。
テスト用のrouteを定義している箇所で、possibly useless use of a constant in void context
ワーニングが出力されていたのを対応しています。
- get '/c', to: lambda { |env| User; [200, {"Content-Type" => "text/plain"}, [$counter.to_s]] } + get '/c', to: lambda { |env| User.name; [200, {"Content-Type" => "text/plain"}, [$counter.to_s]] }
クラスそのまま指定してたのが問題だったようです。こんなワーニングあるんですねえ。
Use select_rows
instead of select_one
in select_value
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
の修正です。
select_value
メソッドで値を取得するのにselect_one
メソッドを使用していのを、select_rows
メソッドを使用するよう修正しています。
select_one
メソッドだとActiveRecord::Result
クラスのインスタンスを生成してしまう為、select_rows
の方がパフォーマンス的に良い為、との事です。
Use select_value
for avoid ActiveRecord::Result
instance creating
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
の修正です。
クラス全体的に、exec_query
メソッドの代わりにselect_values
メソッドを使用するよう修正しています。
exec_query
メソッドだとActiveRecord::Result
クラスのインスタンスが生成されてしまうのですが、先のコミットでselect_value
メソッドではActiveRecord::Result
のインスタンスが生成されないよう改善されたので、そちらを使用するよう修正しています。
Merge pull request #19868 from createdbypete/guides-postgres-uuid-pgcrypto
rails guideのActive Record and PostgreSQL
の修正です。
PostgreSQL 9.4からは、UUIDを生成するのにpgcrypto
モジュールのgen_random_uuid()
関数を使用する事が推奨されるようになったので、その旨UUID
の項を修正しています。
actionview/test/template/url_helper_test.rb
の修正です。
生成されたHTMLを確認するテストでassert_equal
メソッドを使用していたのをassert_dom_equal
メソッドを使用するよう修正しています。
Tiny grammar correction in documentation [ci skip]
rails guideのAction Controller Overview
の修正です。
Other Ways to Use Filters
の項のグラマーの修正を行っています。