なるようになるブログ

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

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

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

CHANGELOGにのったコミットは以下の通りです(詳細は本文参照)。

activesupport/CHANGELOG.md

actionpack/CHANGELOG.md

activerecord/CHANGELOG.md


Merge pull request #14834 from al2o3cr/issue14155

aliasしているテーブルをEager loadする際に、誤ったテーブル名でjoinが発行されてバグを修正しています。


Require active_support at the railties

railtiesのファイルにrequire "active_support"を追加しています。

昨日削除のコミットがあったのですが、やはり必要らしく、戻しています。


Merge pull request #15321 from tgxworld/only_find_routes_as_heads_for_head_request

actionpack/lib/action_dispatch/journey/router.rbの修正です。

REQUEST_METHODHEADの時のみ、get_routes_as_headを呼び出すよう修正しています。


Merge pull request #12080 from ShayDavidson/fix_datetime_partial_dates

activesupport/lib/active_support/core_ext/date_time/calculations.rbの修正です。

DateTimeadvanceメソッドの引数に小数値を指定出来るよう修正しています。

# before
DateTime.now.advance(days: 1, hours: 12)

# after
DateTime.now.advance(days: 1.5)

hoursもいける

DateTime.now.advance(hours: 3.5)

.5は使いそうかなあ。逆にそれ以外の数字は、混乱しそうな。


Silence deprecation warning in test

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

MySQL系のAdapterだった場合にproperty :value_of_e, Type::Integer.newを追加するよう修正しています。

うーん。何でMySQL系だけなんだろう。


give all endpoints a superclass

routingの修正です。

ActionDispatch::Routing::Endpointクラスを新規に作成して、ActionDispatch::Routing配下の各クラスの親クラスとして追加しています。


Test Case - Change method name

activerecord/test/cases/adapters/sqlite3/quoting_test.rbの修正です。

テストメソッド名を適切な名前に修正しています。


constraints class does not need the request class anymore

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

Constraintsコンストラクタからrequestを削除しています。現状不要の為。


call serve with the request on dispatchers

requestがdispatcherだった場合にserveメソッドを呼び出すよう修正しています。


dispatcher doesn't need call anymore

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

Dispatcherクラスからcallメソッドを削除しています。

上記修正で、serveメソッド呼び出すよう修正した為、callが不要になったからですね。

ダックタイピング的にはcallのままで良さそうな気もするのですが、速度の問題なのかなあ…。


move path_parameter encoding check to the request object

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

check_path_parameters!を作成し、共通処理を切り出しています。


rm reset_parameters because we automatically do it from 9ca4839a

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

不要になったreset_parametersメソッドを削除しています。


PARAMETERS_KEY is only used in the request, so move the constant there

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

ActionDispatch::Routing::RouteSet::PARAMETERS_KEYActionDispatch::Http::Parameters#PARAMETERS_KEYに移動しています。

Parametersでしか使用していない為との事です。


rm dead code

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

使用していないinitializeメソッドを削除。


Add test case for clear mappings

activerecord/test/cases/connection_adapters/type/type_map_test.rbの修正です。

mappingをclearした場合のテストケースを追加しています。


Deprecate all _filter callbacks in favor of _action callbacks

*_filter callbacksが全てdeprecateになりました。*_actionに切り替える必要があります。

*_filterRails 5で削除されるとの事です。


Merge pull request #15269 from arunagw/aa-fixes-8930

railties:install:migrationsタスクの修正です。

ファイルの中身がrailties_orderの順に出力されるよう修正しています。

railties:install:migrationsってrails engine用のタスク何ですね。うーん、ちゃんとrails engine触ってみるかあ。


Add CHANGELOG entry for #15269 [ci skip]

上記修正についてCHANGELOGに追加しています。


Remove AR Properties from the public API

ConnectionAdaptersの修正です。昨日追加されたpropertiesを非公開APIに修正しています。

議論が続いているので、一旦下げたようです。残念。


Move types to the top level ActiveRecord namespace

ConnectionAdaptersの修正です。

ActiveRecord::ConnectionAdapters::Type::Value -> ActiveRecord::Type::Valueに修正しています。


pg, keep hstore and json attributes as Hash in @attributes.

PostgreSQLのConnectionAdapterの修正です。

hstorejson型の場合、Hashとして扱うよう修正しています。

duplicationが出来なかったバグの修正との事です。


Initial doc for TransactionIsolationError [ci skip]

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

TransactionIsolationErrorクラスにdocを追加しています。


Add with_default_charset helper.

actionpack/test/controller/content_type_test.rbの修正です。

with_default_charsetメソッドを追加して、共通処理を切り出しています。


Move I18n.locale setting into setup and teardown.

actionpack/test/controller/localized_templates_test.rbの修正です。

I18n.localeの設定をsetup/teardownで行うよう修正しています。


Add and remove renderer inside the test to prevent leak.

actionpack/test/controller/render_other_test.rbの修正です。

このテスト用に追加しているrendererを漏れずに削除するよう、ensure処理の中で削除を行うよう修正しています。


Avoid hardcoded value in teardown.

actionpack/test/controller/request_forgery_protection_test.rbの修正です。

ハードコーディングしている値を変数に設定しています。


Remove unused Column#coder

activerecord/lib/active_record/connection_adapters/column.rbの修正です。

使用していないColumn#coderを削除しています。


Unregister Mime::Type in teardown.

actionpack/test/controller/send_file_test.rbの修正です。

テスト用に登録したMime::Typeをteardownでunregistしています。