なるようになるブログ

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

rails commit log流し読み(2015/04/15)

2015/04/15分のコミットです。

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

actionpack/CHANGELOG.md

actionview/CHANGELOG.md


Merge pull request #19736 from kmcphillips/master

ActionPackActionControllerの修正です。

default_form_builderをcontrollerから指定出来るよう対応しています。

class AdminFormBuilder < ActionView::Helpers::FormBuilder
  def special_field(name)
  end
end
class AdminAreaController < ApplicationController
  default_form_builder AdminFormBuilder
end
<%= form_for(@instance) do |builder| %>
  <%= builder.special_field(:name) %>
<% end %>

Fix typos in the documentation [ci skip]

Merge pull request #19736 from kmcphillips/masterのdocの修正です。

FormBuilderクラスのdocにタイポがあったのを修正しています。


Removing GZip section since Sprockets 3.0 no longer create .gz files [ci skip]

rails guideのThe Asset Pipelineの修正です。

GZip Compressionの項を丸々削除しています。

sprockets 3.0.0からassetのgzipファイルを生成しなくなっていたので、rails guideからもassetのgzipファイルについての記事を削除しています。


avoid double initialization error caused to sidekiq

activejob/test/support/integration/adapters/sidekiq.rbの修正です。

Sidekiqを利用したインテグレーションテストで、Sidekiq::CLI#boot_system#{dummy_app_path}/config/environment.rbを requireしようするとするのですが、左記ファイルはtest/support/integration/helper.rbが既にrequire済みのため、 double initialization errorが発生してしまっていたようです。

Sidekiq::CLIを使用せず、Sidekiq::Launcherを直接使用する事で対応したとの事です。


Enable Active Job integration tests again

.travis.ymlの修正です。

先のsidekiqに関するコミットでActiveJobのintegrationテストが正常に動作するようになったので、allow_failuresからActiveJobのintegrationテストを削除しています。


Use #prepend rather than using 2 aliases

activesupport/lib/active_support/core_ext/range/each.rbactivesupport/lib/active_support/core_ext/range/include_range.rbの修正です。

RubyのバグによりModule#prependが使えず、alias_methodを使用している箇所があったのですが、Ruby 2.2.2で該当箇所がバグフィックスされており、masterブランチではRuby 2.2.2以上を必須にしているので、該当箇所についてもalias_methodではなくModule#prependを使うよう修正しています。


Merge pull request #19446 from andersonDadario/fix_security_guide_captcha_03_21_2015

rails guideのRuby on Rails Security Guideの修正です。

CAPTCHAsの項に、positive CAPTCHA / Negative Captcha についての説明を追加しています。


Revert "Merge pull request #19755 from yuki24/activerecord/support-for-set"

Relation#whereメソッドの引数にSetオブジェクトを渡せるようにしたコミットをrevertしています。

  • これに対応すると、type cast処理でSetに変換出来なくなってしまう
  • Setを対応可能にする、という事はEnumerableを対応可能にするという先例を作る事になるが、Enumerableを直接指定する事は出来ない
  • Arrayは渡せるので、Set#to_aを呼べば対応可能である事

上記理由でrevertしたとの事です。英語が大分あやしいので詳しくはPRのディスカッションをご確認下さい…。


Fix typos and improve the documentation

各種docまとめて修正です。

グラマー、タイポの修正、80文字を越える行の適切な位置に改行を追加等をまとめて行っています。


remove extra = in form builder example [ci skip]

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

FormBuilderのexampleにタイポがあったのを修正しています。


Correct small typo.

rails guideのThe Asset Pipelineの修正です。

disc -> diskにタイポを修正しています。