なるようになるブログ

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

rails commit log流し読み(2016/10/10)

2016/10/10分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

actionpack/CHANGELOG.md


Merge pull request #26738 from bogdanvlviv/travis

.travis.ymlの修正です。

allow_failuresのリストからAction Cableのintegrationテストを削除しています。


Merge pull request #26735 from kamipo/prevent_to_create_blank_comment

Active Recordの修正です。

table及びcolumnのコメントを作成する際、値が空の場合のコメントを作成しないよう修正しています。


Dump index options to pretty format

Active Recordの修正です。

indexのoptionsをschemaファイルにdumpする際、HashのkeyがStringになっていたのを、Symbolになるよう修正しています。

# Before
t.index ["firm_id", "type", "rating"], name: "company_index", order: {"rating"=>:desc}, using: :btree

# After
t.index ["firm_id", "type", "rating"], name: "company_index", order: { rating: :desc }, using: :btree

Remove deprecated methods related to controller filters

actionpack/lib/abstract_controller/callbacks.rbの修正です。

deprecatedになっていたcontrollerのfiltersメソッド(skip_filter, before_filter等)、及びskip_action_callbackメソッドを削除しています。

以降、deprecatedになっていたメソッド削除のコミットが続きます。


Remove deprecation at ActionController::BadRequest

actionpack/lib/action_controller/metal/exceptions.rbの修正です。

deprecatedになっていたActionController::BadRequest#initializeのoriginal exception引数を削除しています。


Remove deprecated support for status option in head

actionpack/lib/action_controller/metal/head.rbの修正です。

deprecatedになっていたheadメソッドのstatusオプションを削除しています。


Remove deprecated support to :back in redirect_to

actionpack/lib/action_controller/metal/redirecting.rbの修正です。

deprecatedになっていたredirect_toメソッドの:backオプションを削除しています。


Remove deprecated support to :nothing in render

actionpack/lib/action_controller/metal/rendering.rbの修正です。

deprecatedになっていたrenderメソッドの:nothingオプションを削除しています。


Remove deprecated support to :text in render

Action Pack、railties、Action Mailerの修正です。

deprecatedになっていたrenderメソッドの:textオプションを削除しています。


Remove deprecated comparing support with ActionController::Parameters

actionpack/lib/action_controller/metal/strong_parameters.rbの修正です。

deprecatedになっていたActionController::ParametersHashの比較処理を削除しています。


Remove deprecated methods in ActionController::Parameters

actionpack/lib/action_controller/metal/strong_parameters.rbの修正です。

ActionController::Parametersクラスからdeprecatedになっていた各種メソッド(ActionController::ParametersHashを継承した事により使えたメソッド)を削除しています。


Remove deprecated xml_http_request and xhr methods

actionpack/lib/action_controller/test_case.rbの修正です。

deprecatedになっていたActionController::TestCasexml_http_requestメソッド及びxhrメソッドを削除しています。


Remove deprecated support to non-keyword arguments #process

actionpack/lib/action_controller/test_case.rbの修正です。

deprecatedになっていたActionController::TestCase#process#get#post#patch#put#delete#headにkeyword arguments以外のパラメータを指定した場合の処理を削除しています。


Remove deprecated access to mime types through constants

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

deprecatedになっていたmime typesの定数参照を削除しています。


Remove deprecated code in ActionDispatch::ParamsParser::ParseError

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

deprecatedになっていたActionDispatch::ParamsParser::ParseError#initializeoriginal_exceptionmessage引数を削除、及び、ActionDispatch::ParamsParser::ParseError#original_exceptionメソッドを削除しています。


Remove deprecated ActionDispatch::ParamsParser

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

DeprecatedになっていたActionController::ParamsParserクラスを削除しています。


Deprecated ActionDispatch::ParamsParser::ParamsParser

Action Packの修正です。

ActionDispatch::ParamsParser::ParseErrorクラスがdeprecateになりました。今後はActionDispatch::Http::Parameters::ParseErrorを使用する必要があります。


Remove deprecated code in ActionDispatch::Session::SessionRestoreError

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

deprecatedになっていたActionDispatch::Session::SessionRestoreError#original_exceptionメソッドを削除、及び`ActionDispatch::Session::SessionRestoreError#initializeconst_error引数を削除しています。


Remove deprecated code in ssl middleware

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

deprecatedになっていたActionDispatch::SSL#initializehostportオプションを削除、及びHSTS subdomainのデフォルトをtrueに変更しています。


Remove deprecated support to passing strings to the middleware stack

actionpack/lib/action_controller/metal.rbactionpack/lib/action_dispatch/middleware/stack.rbの修正です。

deprecatedになっていたmiddleware stackにStringを指定した場合のサポートを削除しています。


Remove deprecated cache_control argument from ActionDispatch::Static#initialize

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

deprecatedになっていたActionDispatch::Static#initializecache_control引数を削除しています。


Remove deprecated support passing path as nil in ActionDispatch::Routing::Mapper#match

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

deprecatedになっていたActionDispatch::Routing::Mapper#matchのpath引数にnilを渡した場合のサポートを削除しています。


Remove deprecated support for passing :path and route path as stings in ActionDispatch::Routing::Mapper#match

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

deprecatedになっていたActionDispatch::Routing::Mapper#match:pathオプション、及び、path引数にstringを合わせて指定した場合の処理を削除しています。


Remove deprecated ActionDispatch::IntegrationTest#xml_http_request

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

deprecatedになっていたActionDispatch::IntegrationTest#xml_http_requestメソッドを削除しています。


Remove deprecated ActionDispatch::IntegrationTest#*_via_redirect.

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

deprecatedになっていたActionDispatch::IntegrationTest#*_via_redirectメソッド(#request_via_redirect#get_via_redirect等)を削除しています。


Remove deprecated support to non-keyword arguments in ActionDispatch::IntegrationTest,

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

deprecatedになっていたActionDispatch::IntegrationTest#process#get#post#patch#put#delete#headにkeyword arguments以外のパラメータを指定した場合の処理を削除しています。


Merge pull request #26578 from jeremy/undeprecate-plural-positional-arg

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

Rails 5.0.0でdeprecatedになっていたpluralizeメソッドのplural引数を引き続きkeyword argumentではなく、positional argumentとして使用出来るよう修正しています。

-      def pluralize(count, singular, deprecated_plural = nil, plural: nil, locale: I18n.locale)
-        if deprecated_plural
-          ActiveSupport::Deprecation.warn("Passing plural as a positional argument " \
-            "is deprecated and will be removed in Rails 5.1. Use e.g. " \
-            "pluralize(1, 'person', plural: 'people') instead.")
-          plural ||= deprecated_plural
-        end
-
+      def pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: I18n.locale)

元々の引数の順番(countsingularplural)は自然な形であり、キーワード引数を無理に使う必要は無いのでは、という事でdeprecatedじゃなくなったとの事です。


name is not a column option

activerecord/lib/active_record/connection_adapters/abstract/schema_dumper.rbactiverecord/lib/active_record/connection_adapters/abstract/schema_statements.rbの修正です。

ActiveRecord::ConnectionAdapters::ColumnDumper#migration_keysメソッドが返すmigration optionsのリストに:nameが入っていたのですが、:nameはmigration optionsに無いので、削除しています。


Add missing @, fix indents. [ci skip]

actionpack/lib/action_controller/metal/redirecting.rbのdocの修正です。

ActionController::Redirectingメソッドのdoc内のタイポ、インデントの調整等を行っています。