2015/06/02分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Remove
assigns
andassert_template
. Both methods have been extracted into a gem at https://github.com/rails/rails-controller-testing.
Merge pull request #20386 from yoongkang/circular_import
activerecord/lib/active_record/schema_migration.rb
の修正です。
circular require
のwarningが出ていたので、'active_record/base'
のrequire処理を削除しています。
Merge pull request #20284 from kaspth/fix-caching-test
actionpack/test/controller/caching_test.rb
の修正です。
viewがcacheされている事を確認するテストで、view内でクラス変数のインクリメント処理を行うようにし、クラス変数の値が変更されてない事で、キャッシュされている事を確認するようテストを追加しています。
Merge pull request #20138 from tgxworld/deprecated_assert_template
actionpack/lib/action_controller/template_assertions.rb
の修正です。
assigns
、assert_template
メソッドがrails本体から取り除かれ、外部gem(rails-controller-testing
)に切りだされました。
取り除かれる事になった背景は、Deprecate assigns() and assert_template in controller testing · Issue #18950 · rails/rails を差参照。
Merge pull request #20362 from kddeisz/enumerable_pluck
activesupport/lib/active_support/core_ext/enumerable.rb
、
activerecord/lib/active_record/relation/calculations.rb
の修正です。
Enumerable#pluck
で複数キーの値を取り出せるよう対応、及び、recordロード済みの場合にCalculations#pluck
メソッドでもEnumerable#pluck
使用するよう修正しています。
[{ id: 1, name: "David" }, { id: 2, name: "Rafael" }].pluck(:id, :name) # => [[1, "David"], [2, "Rafael"]]
各rails guideのタイポをまとめて修正しています。
Use sprockets-rails from github repo
railties/lib/rails/generators/app_base.rb
の修正です。
rails newする際、dev
及びedge
オプションが指定されている場合は、sprockets-rails
のmasterを使用するよう修正しています。
リリース済みのsprockets-rails
だとbin/rake routes
の実行結果がおかしくなってしまう、という問題がある為、開発版のRailsを使う際は、sprockets-rails
開発版を使用するようにしたようです。 詳細は bin/rake routes
on master shows detailed sprockets output · Issue #20397 · rails/rails を参照。
Removed use of mocha from railties actions_test
railties/test/generators/actions_test.rb
の修正です。
railties
のgeneratorの各アクションに関するテストでmocha
を使用しないよう修正しています。
[skip ci] Add documentation for QueueAdapter::queue_adapter
activejob/lib/active_job/queue_adapter.rb
のdocの修正です。
QueueAdapter::queue_adapter
メソッドにdocを追加しています。
Use block variable instead of global
gsub
、sub
メソッドにブロックを渡して処理を行う際、ブロックの中でグローバル変数を使用していたのをローカル変数を使用するよう修正してます。そちらの方が性能的に良いとの事です。
というわけで比較。
require 'benchmark/ips' Benchmark.ips do |x| x.report("$&") { "foo".sub(/f/) { $&.upcase } } x.report("block var") { "foo".sub(/f/) {|match| match.upcase } } end
Skip test that fails from outdated sqlite3 on travis
activerecord/test/cases/relation_test.rb
の修正です。
select
queryにsymbolを渡す際、必ずquote処理を行うよう修正した Ensure symbols passed to select
are always quoted の対応が古いSQLite3では動作しない為、古いSQLite3ではテストが実行されないよう対応しています。
Merge pull request #20387 from y-yagi/fix_engine_generated_controller_test
railtiesのgeneratorの修正です。
rails enginesの中で生成したfunctional testが正常に動作してなかったのを、@routes
にEngineのroutesを設定、fixture名に適切な名前に修正して対応しています。