なるようになるブログ

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

rails commit log流し読み(2014/06/16)

2014/06/16分のコミットです。

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


Remove unused parameter. https://github.com/rails/rails/commit/70312d224a812c4e4b25fdb172284a82bedd0a64

actionpack/lib/action_dispatch/testing/integration.rbの修正です。

使用してない変数を削除しています。


Remove unused param 'separators' from RouteSet#build_path

actionpack/lib/action_dispatch/routing/route_set.rbの修正です。

こちらも使用してない変数の削除。


Change Http::Cache::SPECIAL_KEYS from Array to Set

actionpack/lib/action_dispatch/http/cache.rbの修正です。

Http::Cache::SPECIAL_KEYSをArrayからSetに変更しています。

微妙に性能改善になっているとの事。コミットログにベンチマークが載っていたので、参考までに。

require 'benchmark/ips'
require 'set'

SPECIAL_KEYS = %w[extras no-cache max-age public must-revalidate]
SPECIAL_KEYS_SET = Set.new(SPECIAL_KEYS)
directive = 'must-revalidate'

Benchmark.ips do |x|
  x.report('array') { SPECIAL_KEYS.include?(directive) }
  x.report('set') { SPECIAL_KEYS_SET.include?(directive) }
end
-------------------------------------
   array     67926 i/100ms
     set     74054 i/100ms
-------------------------------------
   array  2318423.4 (±2.8%) i/s -   11615346 in   5.014899s
     set  3387981.8 (±4.7%) i/s -   16958366 in   5.019355s

確かに、setの方が早いですねえ。


Correct typo, add test for validates_absence_of, correct method names

activemodel/test/cases/validations/absence_validation_test.rbの修正です。

テストメソッド名が誤っていたのを修正しています。


Merge pull request #15723 from akshay-vishnoi/sql-correction

activerecord/CHANGELOG.mdの修正です。

a SQLan SQLに修正しています。anなんですね。


Merge pull request #15722 from akshay-vishnoi/spell-correct 各docの修正です。mysqlMySQLに修正しています。