なるようになるブログ

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

rails commit log流し読み(2014/08/28)

2014/08/28分のコミットです。

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


[ci skip] mention assert_select in release notes

rails guideのRuby on Rails 4.2 Release Notesの修正です。

assert_selectの動作が変わっている旨追記しています。

Html Sanitizerに使うライブラリが変更になった影響ですね。


Refactor out Dir.glob from ActionDispatch::Static

actionpack/lib/action_dispatch/middleware/static.rbの修正です。

ActionDispatch::Staticで行っているるファイルの検索処理のリファクタリングです。


Add language directive to .travis.yml

.travis.ymlの修正です。

言語設定が必要との事で、language: rubyを追加しています。


remove dead code

actionview/lib/action_view/template.rbの修正です。

エラーハンドリングを行っていた処理から、begin/rescueを削除しています。

-        begin
-          mod.module_eval(source, identifier, 0)
-          ObjectSpace.define_finalizer(self, Finalizer[method_name, mod])
-        rescue => e # errors from template code
-          if logger = (view && view.logger)
-            logger.debug "ERROR: compiling #{method_name} RAISED #{e}"
-            logger.debug "Function body: #{source}"
-            logger.debug "Backtrace: #{e.backtrace.join("\n")}"
-          end
-
-          raise ActionView::Template::Error.new(self, e)
-        end
+        mod.module_eval(source, identifier, 0)
+        ObjectSpace.define_finalizer(self, Finalizer[method_name, mod])

元々module_evalでERBのコンパイルエラーが起こる可能性がある為対応していたのですが、現在はここでエラーになる事は無いとの事で削除されています。


remove useless parameter

actionview/lib/action_view/template.rbの修正です。

compileメソッドから使用していない変数を削除しています。


Reset schema properly after schema changing test

activerecord/test/cases/locking_test.rbの修正です。

テストの後処理でschemaのリセット処理を追加しています。


Ignore SCHEMA queries when asserting no queries

ActiveRecordのテストの修正です。

SCHEMAクエリを無視してよいテストで、assert_no_queriesignore_none: falseオプションを追加しています。


AP test files does no more need to be alphabetically sorted here

actionpack/Rakefileの修正です。

ストファイルのソート処理を削除しています。現状はアルファベット順に並んでいる必要が無い為、とのことです。


Test everything

actionpack/Rakefileの修正です。

テスト用ファイルの格納先ディレクトリを指定していたのを削除しています。


No need to sort tests

各ライブラリのRakefileの修正です。

ストファイルのソート処理を削除しています。


Rails.root should be a Pathname

railties/test/generators/generators_test_helper.rbの修正です。

Rails.rootを生成する際、Pathname.newで生成するよう修正しています。


Reset RACK_ENV after modified in a test case

railties/test/commands/dbconsole_test.rbの修正です。

ENVのテストで、後処理でENV['RACK_ENV']nilを設定しています。


Expectations first

各テストの修正です。

assert_equalメソッドの引数の順番を修正しています。expected, actualの順番。


Be sure that test fixtures satisfy referential integrity before calculating

activerecord/test/cases/calculations_test.rbの修正です。

ロードするfixturesを追加しています。


Move association definition to the model file

ActiveRecordのテストの修正です。

アソシエーションの定義をmodelの中に移動しています。


Move model definition to test/models for test order indenendency

ActiveModelのテストの修正です。

各テストの中でmodelの拡張を行っていたのを、model内に移動しています。


User Model#last to certainly get lastly created data

activerecord/test/cases/dirty_test.rbの修正です。

データを取るメソッドfirstからlastに修正しています。

fixtures(:binaries)を呼んだテストの後に実行した際に、テストが失敗していたのを修正しています。


make it easy to copy & paste the config from deprecation warning.

activerecord/lib/active_record/transactions.rbのdocの修正です。

raise_in_transactional_callbacksの設定をdocからコピペしやすくする為に、少し体裁を整えています。