なるようになるブログ

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

rails commit log流し読み(2014/07/25)

2014/07/25分のコミットです。

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

activesupport/CHANGELOG.md

activerecord/CHANGELOG.md

ちなみに、今日のコミットと直接関係無いのですが、rails のofficial birthdayはJuly 24らしく、今年で10周年との事です。詳しくはこちら。もう10年なんですねえ。


build fix, fix error introduced with 091b246bb0111357edbb9703ea342a944b04deb6

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

コケてたテストを修正しています。


tests, run adapter specific rake tests only for the right adapter.

ActiveRecordのテストの修正です。

rake taskのテストでadapterのチェックを行うよう修正しています。

例えばactiverecord/test/cases/tasks/mysql_rake_test.rbの場合、if current_adapter?(:MysqlAdapter, :Mysql2Adapter)を行うよう対応しています。


Make HWIA copy the default proc too.

Hash#with_indifferent_accessの修正です。

デフォルトのprocについてもコピーするよう対応しています。

hash = Hash.new do
  2 + 1
end
hash[:foo] # => 3

hash_wia = hash.with_indifferent_access 
hash_wia[:foo] #=> 3

Bug fix for assert_template when opening a new session.

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

新規セッション作成時に、assert_templateが正常に動作してなかったのを修正しています。clear処理が足りてなかったのを足しています。


Improve description of tests.

actionpack/test/dispatch/template_assertions_test.rbの修正です。

テストメソッド名を改善しています。


Add support for Postgresql JSONB

PostgreSQLのConnectionAdapterの修正です。

JSONB型のサポートを追加しています。

PostgreSQL9.4からJSONB型追加になるんですね。


adding indexes on tables in migration scripts

rails guideのActive Record Associationsの修正です。

サンプルにindexの設定追加しています。


docs, add ref where to find valid head status symbols.

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

headメソッドに指定出来るstatusの値については、Rack::Utils::SYMBOL_TO_STATUS_CODEを確認してくれ、という説明を追加しています。

因みにSYMBOL_TO_STATUS_CODEは以下の内容です。

    HTTP_STATUS_CODES = {
      100 => 'Continue',
      101 => 'Switching Protocols',
      102 => 'Processing',
      200 => 'OK',
      201 => 'Created',
      202 => 'Accepted',
      203 => 'Non-Authoritative Information',
      204 => 'No Content',
      205 => 'Reset Content',
      206 => 'Partial Content',
      207 => 'Multi-Status',
      208 => 'Already Reported',
      226 => 'IM Used',
      300 => 'Multiple Choices',
      301 => 'Moved Permanently',
      302 => 'Found',
      303 => 'See Other',
      304 => 'Not Modified',
      305 => 'Use Proxy',
      306 => 'Reserved',
      307 => 'Temporary Redirect',
      308 => 'Permanent Redirect',
      400 => 'Bad Request',
      401 => 'Unauthorized',
      402 => 'Payment Required',
      403 => 'Forbidden',
      404 => 'Not Found',
      405 => 'Method Not Allowed',
      406 => 'Not Acceptable',
      407 => 'Proxy Authentication Required',
      408 => 'Request Timeout',
      409 => 'Conflict',
      410 => 'Gone',
      411 => 'Length Required',
      412 => 'Precondition Failed',
      413 => 'Request Entity Too Large',
      414 => 'Request-URI Too Long',
      415 => 'Unsupported Media Type',
      416 => 'Requested Range Not Satisfiable',
      417 => 'Expectation Failed',
      418 => 'I\'m a teapot',
      422 => 'Unprocessable Entity',
      423 => 'Locked',
      424 => 'Failed Dependency',
      426 => 'Upgrade Required',
      428 => 'Precondition Required',
      429 => 'Too Many Requests',
      431 => 'Request Header Fields Too Large',
      500 => 'Internal Server Error',
      501 => 'Not Implemented',
      502 => 'Bad Gateway',
      503 => 'Service Unavailable',
      504 => 'Gateway Timeout',
      505 => 'HTTP Version Not Supported',
      506 => 'Variant Also Negotiates (Experimental)',
      507 => 'Insufficient Storage',
      508 => 'Loop Detected',
      510 => 'Not Extended',
      511 => 'Network Authentication Required'
    }