2017/01/16分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
mocha gemのバージョンを1.2.1
に更新した、bundle u mochaをrevertしています。Active Recordのテストがコケてしまうようになった為。
Don't guard against touch: []
.
activerecord/lib/active_record/counter_cache.rb
の修正です。
counter cacheの更新処理でtouch_updates
が空の場合のガード処理を削除しています。
- touch_updates = touch_updates(touch) - updates << sanitize_sql_for_assignment(touch_updates) unless touch_updates.empty? + updates << sanitize_sql_for_assignment(touch_updates(touch))
ここでtouch_updates
はempty?
になるのはtouch
オプションに空配列(touch: []
)を指定したようなケースで、わざわざガード処理を入れる必要は無いだろう、という事で削除されています。
が、上記ケース以外に、modelにupdate timestamp attributes(e.g. updated_at
、updated_on
)が無い場合にもtouch_updates
は空になり、そちらはガードすべきケースなので、後ほどrevertされています。
Revert "Merge pull request #27686 from koic/friendly_bigdecimal_inspect"
BigDecimal
のexampleコードを表示している箇所にRuby 2.4.0の場合の出力例を追加した、Several representation of BigDecimal has changed in Ruby 2.4.0+ [ci skip]をrevertしています。
2つの例を追加すると混乱する可能性がある、かつ、RailsのmasterはまだRuby 2.2.2をサポートしている為、古い方の結果を載せておいた方が良いだろう、という判断の為のようです。
Merge pull request #27618 from kamipo/fix_uuid_default_nil
activerecord/lib/active_record/migration/compatibility.rb
の修正です。
primary keyに:uuid
を使用している場合に、default
オプションを使用しているかどかのチェックに[]
メソッドを使用していたのを、key?
メソッドを使用するよう修正してます。
- if options[:id] == :uuid && !options[:default] + if options[:id] == :uuid && !options.key?(:default)
default
オプションにはnilを指定する事が出来る為、[]
メソッドだと値がnilの場合に正しくチェック出来ない為。
Merge pull request #27601 from y-yagi/make_work_all_commands_from_engine
railtiesの修正です。
raile engineの中から、server
、console
、dbconsole
、runner
コマンドを使用出来るよう修正しています。
Revert "Don't guard against touch: []
."
counter cacheの更新処理でtouch_updates
が空の場合のガード処理を削除した、Don't guard against touch: []
.をrevertしています。理由は上記の通り。
Merge pull request #27683 from eugeneius/update_counters_empty_touch_test
activerecord/test/cases/counter_cache_test.rb
の修正です。
update_counters
メソッドのtouchオプションに空配列(touch: []
)を指定した場合のテストを追加しています。
activesupport/test/string_inquirer_test.rb
の修正です。
StringInquirer#respond_to_missing?
が親クラスにフォールバックする事を確認するテストで、テストの後処理でrespond_to_missing?
を再定義する際に、不要な処理が含まれてしまっていたのを、削除しています。
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
不足していたactive_support/core_ext/regexp
のrequireを追加しています。
ActionController::Parameters#permit
の高速化を行った、significant speedup of AC::Parameters#permitをrevertしています。
fields_for-styleのnestしたparamsに対してto_h
メソッドを呼び出した際に正しい値が取得出来なくなってしまった為、revertしたとの事です。
actionpack/test/controller/parameters/nested_parameters_permit_test.rb
の修正です。
fields_for-styleのnestしたparamsに対してto_h
メソッドを呼び出した際の結果を確認するテストを追加しています。
Translate Foreign Key violation to the specific exception for SQLite3 adapter
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
の修正です。
外部キー制約違反でデータの挿入 / 更新に失敗した場合に、SQLite3 adapterでもActiveRecord::InvalidForeignKey
をraiseするよう修正しています。
Allow SQLServerAdapter to opt into a few tests.
Actie Recordのテストの修正です。
幾つかのテストで、SQLServerAdapter
でもテストが通るよう、adapterのチェック処理を修正しています。
- if current_adapter?(:PostgreSQLAdapter) + if current_adapter?(:PostgreSQLAdapter, :SQLServerAdapter)
Merge pull request #27699 from kenta-s/update-comment-for-scrubber-usage
actionview/lib/action_view/helpers/sanitize_helper.rb
のdocの修正です。
ActionView::Helpers::SanitizeHelper
moduleのdoc内の独自のHtml scrubberを作成する場合のexampleコードが古いままにっていたのを更新しています。