2015/03/11分のコミットです。
CHANGELOGへの追加はありませんでした。
Attempt to provide backwards compatible YAML deserialization
ActiveRecordの修正です。
ActiveRecord::LegacyYamlAdapter
moduleを作成し、
ActiveRecordのインスタンスをYAMLに変換した時のフォーマットがRails 4.1 -> 4.2で変わってしまい、Rails 4.1でYAMLに変換したデータを正しくデシリアライズ出来るよう、変換処理を追加しています。
Add YAML compatibility for objects from Rails 4.2
activerecord/lib/active_record/legacy_yaml_adapter.rb
の修正です。
Ruby 2.2から、Psychがシリアライズ出来るオブジェクトの種類が増えています。で、元々シリアライズ出来なかったオブジェクトがシリアライズ出来るようになったのですが、以前までPsynchが正しくシリアライズ出来なかったオブジェクトについて、Railsは独自に実装したinit_with
とencode_with
メソッドで対応していたのですが、この処理がPsychと互換性が無い為、Rails 4.2で作成したYAMLのデータを正しくデシリアライズ出来るように、変換処理を追加しています。
Let strip_tags leave HTML escaping to Rails.
Gemfile
及びactionview/lib/action_view/helpers/sanitize_helper.rb
の修正です。
strip_tags
メソッドでfull_sanitizer.sanitize
メソッドを呼び出す際に、encode_special_chars: false
オプションを設定し、特殊文字を指定した際に変換処理が行われないよう修正しています。
# before helper.strip_tags("test\r\n\r\ntest") # => "test \n \ntest" # after helper.strip_tags("test\r\n\r\ntest") # => "test\r\n\r\ntest"
Gemfile
の修正です。
release済みのrails-html-sanitizer
を使用するよう修正しています。
activerecord/test/cases/adapters/postgresql/json_test.rb
の修正です。
JSONのテストの後処理で、JsonDataType.reset_column_information
メソッドを呼び出すよう修正しています。
先日行われたarrayのテスト同様、テスト中にテーブルの情報を変更してしまっているテストがあり、その影響でコケてしまうテストがある為、リセット処理を行うよう対応しています。
fix typo in transaction argument. Closes #19265.
activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb
の修正です。
disable_referential_integrity
メソッド内で呼び出しているtransaction
メソッドの引数名をタイポ(require_new
-> requires_new
)していたのを修正しています。
pg, disable_referential_integrity
only catches AR errors.
activerecord/lib/active_record/connection_adapters/postgresql/referential_integrity.rb
の修正です。
disable_referential_integrity
メソッドでActiveRecord::ActiveRecordError
クラスのエラーのみrescue
するよう修正しています。
[ci skip] Change to code element
rails guideのRails Routing from the Outside In
の修正です。
Translated Paths
の項のresource
をバッククォートで囲むよう修正しています。
Unnecessary usage of self in the guides
rails guideのActive Record Callbacks
の修正です。
Callback Registration
の項のexampleから、不要なself
を削除しています。