なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2015/12/29)

2015/12/29分のコミットです。

CHANGELOGへの追加はありませんでした。


Add a missing require to ActiveSupport::NumericWithFormat

activesupport/lib/active_support/core_ext/numeric/conversions.rbの修正です。

active_support/core_ext/module/deprecationのrequireを不足していたので、追加しています。


Add test coverage for ActiveSupport::NumericWithFormat#to_formatted_s

activesupport/test/core_ext/numeric_ext_test.rbの修正です。

ActiveSupport::NumericWithFormat#to_formatted_sメソッドがdeprecateになっている事を確認するテストが不足していたので、追加しています。


Fix - to_s(:db) on Numeric range

activesupport/lib/active_support/core_ext/numeric/conversions.rbの修正です。

numericのrangeオブジェクトでto_s(:db)メソッドを呼び出した際に、エラーになっていたのを正常に動作するよう修正しています。

# before
(1..100).to_s(:db) # => TypeError: no implicit conversion of Symbol into Integer

# after
(1..100).to_s(:db) # => "BETWEEN '1' AND '100'"

こんな使い方出来るんですねえ。