なるようになるブログ

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

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

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

namespaceを使用しているクラスでhas_and_belongs_to_manyを使用した場合にエラーとなるバグの修正、RFC4791対応等が行われています。

このスペースに何書こうか割と迷うので、明日からはCHANGLOGにのった修正まとめてみようと思います。多分。


Merge remote-tracking branch 'apotonick/simplify-prefixes'

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

AbstractController::Base::parent_prefixesがDeprecateになりました。view検索の処理を変更したい場合は、AbstractController::Base::local_prefixesをオーバーライドする必要があります。

テストコードから抜粋。

class OverridingLocalPrefixes < AbstractController::Base
  include AbstractController::Rendering
  include ActionView::Rendering
  append_view_path File.expand_path(File.join(File.dirname(__FILE__), "views"))


  def index
    render
  end

  def self.local_prefixes
    # this would usually return "abstract_controller/testing/overriding_local_prefixes"
    super + ["abstract_controller/testing/me3"]
  end

  class Inheriting < self
  end
end

あまりviewのpathを変更したい、というケースは無かったのですが、そういう場合は使えそうですね。

因みに、このPRはcellsの作者の方が送られています。cellsだと確かに使いそう。


Improve CHANGELOG entry

CHANGELOGの修正です。スペースの追加。


._prefix is private API so we should not recommend to override it

上記actionview/lib/action_view/view_paths.rbの修正の続きです。

privateメッセージをオーバーライドするようメッセージに出力してしまっていたので、削除しています。


Mark _prefix as nodoc

こちらもactionview/lib/action_view/view_paths.rbの修正です。

privateメソッドに:nodoc:を追加しています。


Follow the documentation guideline

こちらもactionview/lib/action_view/view_paths.rbの修正です。

::_prefixes._prefixesに修正しています。

railsのguidelineに則った形ですね。


Refactoring the code to make consitional return explicit

こちらもactionview/lib/action_view/view_paths.rbの修正です。

戻り値が少し解りづらかったのでリファクタリングしています。


Following documentation guideline

actionview/test/actionpack/abstract/abstract_controller_test.rbの修正です。

::.に修正しています。二つ上の修正と同じく、railsのguidelineに則った形ですね。


We need an explicit return

こちらもactionview/lib/action_view/view_paths.rbの修正です。

early return しているのを修正しています。

値がメモ化されるのを避けるため、early returnはしないようにしている、との事です。

訳があってるか不安…。


Update Redcarpet to 3.1.2

gemfileの修正です。

Redcarpetのバージョンを3.1.2にあげています。


[ci skip]add updated information, ref[#522c0fd]

ActiveRecord::AttributeMethods::[]メソッドのdocの修正です。

:idはいつも空白である旨追加されています。


remove warning ambiguous first argument; put parentheses or even spaces

activerecord/test/cases/adapters/postgresql/datatype_test.rbの修正です。

複数引数のメソッド呼び出しで()が無かったのを追加しています。 warningが出てたのの対応です。


rake, remove frontbase related tasks from Active Record Rakefile.

activerecord/Rakefileの修正です。

frontbaseに関するtaskを削除しています。

frontbaseってなんだろうと思ったんですが、これか。こんなRDBMSあったのか。


Merge pull request #15070 from ayamomiji/sse-patch

ActionController::Live::SSE#perform_writeメソッドの修正です。

Server-Sent Eventsで複数のdata:行に対応出来るよう修正しています。

Server-Sent Events についてはこちら参考。


Merge pull request #14137 from dasch/better-fragment-cache-instrumentation https://github.com/rails/rails/commit/f2bff250a017b6da76b7587a164643db31ffbf9b

ActionController::Caching::Fragments#instrument_fragment_cacheメソッドの修正です。

frament cacheではActiveSupport::Notifications.instrumentを使って計測を行っているのですが、計測時の情報にコントローラー名とアクション名が追加されています。

ActiveSupport::Notifications、ちゃんと使うと性能測定にとても便利そうなんですよねえ。


Make filter_binds filter out symbols that are equal to strings

ActiveRecord::Relation::Merger#filter_bindsメソッドの修正です。

カラム名の比較をStringSymbolで行ってしまった為、値のマッチングが出来ずにエラーになってしまったバグの修正です。

こちらのgist参照

has_many .. foreign_key使用している際に駄目そうなので、割と起きそうに見えるなあ。


Merge pull request #14871 from kassio/kb-fixes-namespaced-habtm

activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rbの修正です。

namespaceを使用しているクラスでhas_and_belongs_to_manyを使用した場合に、名前解決が出来ずエラーになってしまったバグの修正です。

Rails 4.0では動いていたので、4.1にあげる際に注意が必要そうです。


Don't use Active Support where it is not needed.

activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb

String#presenseメソッド使用している箇所を修正しています。

疎結合にする為ですかね。


Merge pull request #15088 from kares/shareable-modules

Postgresqlのadapter関連ファイルの修正です。

クラス名のリファクタリングが行われており、class PostgreSQLColumn < Columnmodule PostgreSQLに修正しています。


Methods of these modules are internal

Postgresqlのadapter関連ファイルの修正です。

private メソッドにnodocを付けています。


:scissors:

こちらもPostgresqlのadapter関連ファイルの修正です。

不要行の削除。


Add missing requires for require 'action_dispatch/routing'

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

require 'active_support/dependencies/autoload'を追加しています。


Only path requirements are relevant to optimized urls

ActionDispatch::Routing::RouteSet.optimize_helper?メソッドの修正です。


Remove unused method in RouteSet test.

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

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


update ruby-oci8 version specification. Closes #15109. [ci skip]

Gemfileの修正です。

ruby-oci8のバージョンをあげています。


flexible ruby-oci8 version specification. [Gaurav Sharma]

Gemfileの修正です。

ruby-oci8のバージョン指定を2.1.0から2.1に修正。


Add RFC4791 MKCALENDAR method

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

RFC4791のMKCALENDARメソッドを定数に追加しています。

カレンダーサーバの為の規格なんですね。へー。

詳しくはこちら