2016/01/22分のコミットです。
CHANGELOGへの追加はありませんでした。
actionpack/test/controller/api/renderers_test.rb
の修正です。
Rails APIのテストで、deprecateになったget :text
を使用している箇所があり、deprecateメッセージが表示されてしまっていたので、該当のテストをassert_deprecated
で囲んで対応しています。
rails guideのGetting Started with Rails
の修正です。
Generating a Model
の項、migrationファイルにおける:references
キーワードについての説明を追加しています。
Use bind parameters for ranges in where clauses
Active Recordの修正です。
where
句にRangeクラスを指定した場合に、bind parametersを使用するよう修正しています。
Do not cache prepared statements that are unlikely to have cache hitsでSQLにin
を含む場合にプリペアドステートメントを内部的にキャッシュしないよう修正されたのですが、その際の対応漏れのようです。
Merge pull request #23078 from y-yagi/add_application_mailer_rb_to_mountable_engine
Railtiesの修正です。
rails engineを新規作成する際、mailerの親クラス(ApplicationMailer
)を生成するよう修正しています。
Fix ActionController::Parameters#==
bug
actionpack/lib/action_controller/metal/strong_parameters.rb
の修正です。
Hash
とActionController::Parameters
を==
で比較した際に、正しく比較処理が行われるよう修正しています。
hash = { foo: :bar } params = ActionController::Parameters.new(hash) params == hash #=> 元々falseになってしまっていたのがtrueになった
==
メソッドで、引数がHash
だった場合、HashWithIndifferentAccess
に変換してから比較処理を行うようにして対応を行っています。
Remove action_cable_meta_tag when skip action_cable
railties/lib/rails/generators/rails/app/app_generator.rb
の修正です。
rails newに--skip-action-cable
を指定した際に、不要なAction Cableのメソッドの呼び出し(action_cable_meta_tag
)が残ってしまっていたのを削除しています。
Add config/cable.yml
to list of default files in Rails generator
railties/test/generators/app_generator_test.rb
の修正です。
Railsがデフォルトで生成するファイルの一覧にconfig/cable.yml
を追加しています。
Merge pull request #23080 from prathamesh-sonpatki/fix-cache-key-for-loaded-empty-collection
activerecord/lib/active_record/collection_cache_key.rb
の修正です。
ActiveRecord::Relation#cache_key
メソッドで、collectionがload済み、かつ、collectionの数が0だった場合にエラーになっていたのを対応しています。
if collection.loaded? size = collection.size - timestamp = collection.max_by(×tamp_column).public_send(timestamp_column) + if size > 0 + timestamp = collection.max_by(×tamp_column).public_send(timestamp_column) + end
collectionの数が0だった場合に、max_by
の戻り値がnilになるのですがnilに対してpublic_send
を呼びだそうとしてエラーになってしまっていたとの事です。collectionの数が0の場合は、該当の処理を行わないようにして対応しています。
First pass over parts of Testing guide
rails guideのA Guide to Testing Rails Applications
の修正です。
全体的なグラマーの修正、assert_send
メソッドのexampleの追加等をまとめて行っています。
rm changelog for unreleased changes fixes
actionpack/CHANGELOG.md
の修正です。
4.2からの変更ではない不要なentryがあったのを削除しています。
remove per_form_csrf_tokens
initializer from Rails API
railties/lib/rails/generators/rails/app/app_generator.rb
の修正です。
Rails APIではper_form_csrf_tokens
initializer(form毎に異なるCSRF tokenが生成するかどうかを指定するためのinitializer)が生成されないよう修正しています。 Rails APIではform無い為、
[ci skip] Add note about tsrange and timezone awareness to docs
activerecord/lib/active_record/timestamp.rb
のdocの修正です。
Timestamp
moduleのdocに、ActiveRecord::Base.time_zone_aware_types
(timezoneを使用する型を指定する為のattribute)についての説明を追加しています。