2014/04/15分のコミットです。
respond_to
でany
を指定した際の挙動が4.0.4と4.1で変わってしまっていたバグの修正が含まれています。使われている方は、ご注意を。
[ci skip] Added link to ruby-lang.org installation.
rails guideの修正。
Rubyのインスールについての参考リンク先をhttps://www.ruby-lang.org/en/downloads/
からhttps://www.ruby-lang.org/en/installation/
に修正しています。
Refine tests for assert_select failure messages
テストコードの修正です。 エラーメッセージの確認をするテストで、文字列の先頭に"\A"、終端に"$"を追加して、より正確に確認するようにしています。
before assert_failure(/Expected at least 1 element matching \"p\", found 0/) { assert_select "p" } after assert_failure(/\AExpected at least 1 element matching \"p\", found 0\.$/) { assert_select "p" }
終端チェックを"\z"で実施してないのが少し気になります。
Fix subscriptions not being unsubscribed.
テストコードの修正です。
ActiveSupport::Notifications.subscribe
の戻り値を配列に格納し、teardown
の際にその配列の値をunscribe
するよう修正しています。
Use inheritance chain instead of callbacks to increment counter caches after create
昨日あったcounter cacheのバグ修正のリファクタリングです。
counter cacheの作成処理をCounterCache
のconcern
内に移動しています。
callback
からメソッドチェーンに移動したので、処理漏れが無くなった、という事でしょうか。すいません、大分怪しいです…。
Use inheritance chain instead of callbacks to increment counter caches after destroy
上記コミットの削除処理対応です。
現状の仕様と異なるコメントの削除。
Return null type format when format is not know
#any
を使用している際に、認識出来ないformatでリクエストがあった際に、ActionController::UnknownFormat
が発生してしまうバグの修正。
def my_action respond_to do |format| format.json { head :ok } format.any { render text: 'Default response' } end end
上記の用にメソッドが定義されていた際に、my_action.phpにリクエストを投げると、エラーになってしまっていました。
rails 4.0.3では問題なく、rails 4.0.4でエラーが発生するようになってしまっています。
4-0-stableにバックポートされているので、該当の処理を記載されている方はご注意下さい。
テストコードの修正。不要なスペースを削除しています。
Make console and generators blocks works at Application instance level
console
とgenerators
ブロックがApplication instance生成時に動作するよう修正しています。
Example: MyApplication::Application.configure do console do require "pry" config.console = Pry end end
こちらも、rails 4.0.xで動いていいて、rails 4.1動作しなくなった処理です。
railties/lib/rails/application.rb
にconsole
及びgenerators
メソッドを定義して対応しています。
The Association Relation should use empty?
and size
from Relation.
このコミットでAssociationRelationにsize
及びempty?
メソッドが定義されましたが、それにより結果が変わってしまうバグが発生してしまっていました。
Example: # Given an author that does have 3 posts, but none of them with the # title 'Some Title' Author.last.posts.where(title: 'Some Title').size # => 3
AssociationRelationからsize
及びempty?
メソッドを削除し、Relationのメソッドが呼ばれるようにして対応を行っています。
Make sure the column_name is different from 'all'.
上記コミットの続きです。
通常のカラム名を指定した場合と、:all
を指定した場合とで、calcurationsの挙動が異なるので、:all
が指定された際に適切なメソッドが呼ばれるよう、カラム名のチェック処理を追加しています。
[ci skip] Add missing end in one of the examples in Migrations.md.
rails guideの修正。exampleにendが足りてなかったのを追加しています。
use YAML.load_file in database tasks example
activerecord/lib/active_record/tasks/database_tasks.rb
のコメントの修正です。
YAMLのload処理の記述をYAML.load_file
を使うよう修正しています。
before DatabaseTasks.database_configuration = YAML.load(File.read('my_database_config.yml')) after DatabaseTasks.database_configuration = YAML.load_file('my_database_config.yml')