2016/04/04分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Update Rails 5 release notes [ci skip]
rails guideのRuby on Rails 5.0 Release Notes
の修正です。
重複していた各entryを削除しています。
activesupport/test/autoloading_fixtures/raises_arbitrary_exception.rb
、
activesupport/test/autoloading_fixtures/throws.rb
の修正です。
autoloadingのテスト用fixtureで、定数宣言をした際に値を_
に代入するよう修正しています。
void context のwarningが出るのを防止するため、との事です。
Use block form of Dir.mktmpdir to ensure tidy up
activesupport/test/file_update_checker_shared_tests.rb
の修正です。
テスト用に作成したtmp directoryを、テストの後処理で削除していたのを、Dir.mktmpdir
のblock内で処理を行うよう修正しています。
テストを途中で中断した場合にも、確実にtmp directoryを削除出来るようにする為。
Call super instead of returning nil for DateTime#<=>
activesupport/lib/active_support/core_ext/date_time/calculations.rb
の修正です。
DateTime#<=>
メソッドで、引数のobjectがInfinity
でない、かつ、to_datetime
メソッドが実装されてない場合にnilを返していたのを、superを呼び出すよう修正しています。
def <=>(other) - if other.kind_of?(Infinity) - super - elsif other.respond_to? :to_datetime + if other.respond_to? :to_datetime super other.to_datetime rescue nil else - nil + super end
RubyオリジナルのDateTime#<=>
では、引数がNumericが渡された場合も比較処理が行われる(ユリウス通日を使用しての比較処理が行われる)為、引数がDateTime以外の場合も動作するよう、修正したとの事です。
Match String#to_time
's behaviour to ruby
activesupport/lib/active_support/core_ext/string/conversions.rb
の修正です。
不正なStringに対してto_time
メソッドを呼び出した際に、今日のdate(時間は0:00)のインスタンスが返していたのを、nilを返すよう修正しています。
# before '010'.to_time # => 2016-04-04 00:00:00 +0900 # after '010'.to_time # => nil
Ruby本体の挙動に合わせる為、との事です。
Merge pull request #24247 from ypxing/refactor_substitute_values
activerecord/lib/active_record/relation.rb
の修正です。
ActiveRecord#substitute_values
メソッドで、引数のvalues
に対して2回ループを行っていたのを、一度で済むようリファクタリングを行っています。
actionpack/lib/action_controller/metal/cookies.rb
の修正です。
ActionController::API
にActionController::Cookies
moduleをincludeした場合に、エラーになってしまう場合があったのを、正常に動作するよう修正しています。
ActionController::Cookies
moduleでhelper_method
を使用しているのですが、ActionController::API
はデフォルトではAbstractController::Helper
をincludeしておらず、helper_method
が定義されてない為、エラーになってしまっていました。helper_method
を使用する前に、helper_method
が定義済みかどうかチェックを入れるよう修正しています。
included do - helper_method :cookies + helper_method :cookies if defined?(helper_method) end