2017/04/07分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Improve logging when Origin header doesn’t match
actionpack/lib/action_controller/metal/request_forgery_protection.rb
の修正です。
CSRF tokenのチェックでエラーになった場合、かつ、異なるoriginからのリクエストだった場合に、ログにその詳細(e.g. HTTP Origin header (http://bad.host) didn't match request.base_url (http://test.host)
)を出力するよう修正しています。
Fix warning: already initialized constant HashWithIndifferentAccessTest::HashWithIndifferentAccess
activesupport/test/hash_with_indifferent_access_test.rb
の修正です。
HashWithIndifferentAccess
を再定義している事によるRubyのwarningがでていたので、不要な定義処理を削除し対応しています。
Remove duplicated “test” prefix
各テストから、重複していた"test"という文字を削除しています。
例。
- test "test type casting with emulated booleans" do + test "type casting with emulated booleans" do
Merge pull request #28632 from kamipo/fix_warning_extra_states_are_no_longer_copied
activemodel/lib/active_model/errors.rb
の修正です。
ActiveModel::Errors
でRubyのwarning(warning: extra states are no longer copied
)が出ていたのを修正しています。
def values - messages.reject do |key, value| - value.empty? + messages.select do |key, value| + !value.empty? end.values end
default_proc
が設定されているHash
に対してreject
メソッドを呼び出すと上記warningが出てしまうので、select
を使用するよう修正したようです。知らなかった。
参考:https://github.com/ruby/ruby/blob/v2_4_1/hash.c#L1335-L1337
Merge pull request #28670 from aledalgrande/activerecord-docs-fix
rails guideのActive Record Callbacks
の修正です。
Halting Execution
の項でcallback chainを止める方法にfalse
をreturnする旨説明が記載されていたのを、throw :abort
を行う必要がある旨説明を修正しています。
activerecord/lib/active_record/fixtures.rb
の修正です。
fixturesのaccessor methodに引数を指定しなかった場合に、全てのfixtureの値を返すよう修正しています。
# todo.yml # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html one: title: MyString user: one two: title: MyString user: two
# before todos # => [] # after todos # => [#<Todo id: 980190962, title: "MyString", user_id: 980190962, created_at: "2017-04-07 21:30:11", updated_at: "2017-04-07 21:30:11">, #<Todo id: 298486374, title: "MyString", user_id: 298486374, created_at: "2017-04-07 21:30:11", updated_at: "2017-04-07 21:30:11">]