2016/03/30分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
actioncable/CHANGELOG.md
Delegate some additional methods in querying.rb
activerecord/lib/active_record/querying.rbの修正です。
ActiveRecord::Querying moduleがdelegateするメソッドの一覧に、empty?, none? 及び one?を追加しています。
# テーブルにレコードが無い場合 Topic.empty? # => true Topic.none? # => true # テーブルにレコードが1件だけある場合 Topic.one? # => true
割と便利そう。
Add a test case for create a record with primary key as zero
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb、
activerecord/test/cases/adapter_test.rbの修正です。
primary keyの値が0の場合のテストを追加しています。
Book.create(id: 0) assert_equal 0, Book.find(0).id assert_nothing_raised { Book.destroy(0) }
そうか、0でも大丈夫なんですねえ。
Remove except helper for test schema
activerecord/test/schema/schema.rbの修正です。
指定されたadapterを除外する為のexceptメソッドを削除しています。機能毎に、その機能をサポートしているかどうかを確認するヘルパーメソッドがあり、そちらを使えば良い為。
update assert_no_performed_jobs doc to use assert_no_performed_jobs method [ci skip]
activejob/lib/active_job/test_helper.rbのdocの修正です。
assert_no_performed_jobsメソッドのdoc内のexampleがassert_performed_jobsを使用するexampleになってしまっていたのを、assert_no_performed_jobsメソッドを使用するexampleに修正しています。
Merge pull request #24327 from bogdanvlviv/patch-2
activerecord/lib/active_record/migration/compatibility.rbの修正です。
index_exists?メソッドでkeyの値のチェックに#key?メソッドを使用していたのを、#[]メソッドを使用するよう修正しています。
- if options.key?(:name).present? + if options[:name].present?
値を取得しようとしてる処理なので、単純に#key?を使ってたのはミスっぽい。
Merge pull request #24349 from chrisarcand/add-changelog-for-24305
activerecord/CHANGELOG.mdの修正です。
db:migrate task完了時に、schema cacheをclearするよう修正した Make 'migrate' clear the schema cache afterward by chrisarcand · Pull Request #24305 · rails/railsの対応について、CHANGELOGにentryを追加しています。
Merge branch 'actioncable-notifications'
actioncable/lib/action_cable/channel/base.rbの修正です。
ActionCable::Channelの各種処理にActiveSupport::Notificationsのhookを追加しています。
追加されたhookは、perform_action.action_cable、transmit.action_cable、transmit_subscription_confirmation.action_cable、transmit_subscription_rejection.action_cableの4つです。
actioncable/CHANGELOG.mdの修正です。
先のActiveSupport::Notificationsのhook追加対応のentryに、不要なクラス(ActiveSupport::LogSubscriber)の記載があったので削除しています。
Merge pull request #23895 from glaucocustodio/add_upcase_first_method
activesupport/lib/active_support/core_ext/string/inflections.rb、
activesupport/lib/active_support/inflector/methods.rbの修正です。
先頭の文字を大文字に変換するupcase_firstをStringクラスに追加しています。
'what a Lovely Day'.upcase_first #=> "What a Lovely Day"
Deprecate ActionDispatch::ParamsParser instance.
actionpack/lib/action_dispatch/middleware/params_parser.rbの修正です。
ActionDispatch::ParamsParserのインスタンス生成処理を行った際に、ActionDispatch::ParamsParserはdeprecateになった旨メッセージを表示、及び、mostly remove the ParamsParser middleware · rails/rails@38d2bf5でActionDispatch::ParamsParserがmiddleware stackから削除された対応について、CHANGELOGにentryを追記しています。
任意のparameter parserを使用したい場合は、今後ActionDispatch::Request.parameter_parsers=メソッドを使用する必要があります。
Fix deprecation warning for ParamsParser instance :smile:
actionpack/lib/action_dispatch/middleware/params_parser.rbの修正です。
先のActionDispatch::ParamsParserの対応で追加されたdeprecatemメッセージ内にタイポしている箇所があったのを修正しています。
Fix rails restart issue with Puma
railtiesの修正です。
PumaをAPサーバに使用していた場合に、rails restartでPumaのrestart処理が正しく行われないバグがあったのを修正しています。
Pumaに渡す為のパラメータが足りて無かったようです。
また、Puma側にも対応(Configurationを上書き出来るようにする対応)が必要なのですが、そちらはまだ対応中(Allow overriding options of Configuration object by prathamesh-sonpatki · Pull Request #936 · puma/puma)のようです。
Pass over CHANGELOGs [ci skip]
actionmailer/CHANGELOG.md、activerecord/CHANGELOG.mdの修正です。
各entryのフォーマットの修正、不要な行の削除等を行っています。
Run latest precompiled JRuby on CI only against ActionPack
.travis.yml、Gemfileの修正です。
JRuby + Action PackのテストをTravis CI上で実行するよう修正しています。
provide file name for fixture ERB
activerecord/lib/active_record/fixture_set/file.rbの修正です。
fixtureでERBのインスタンスを生成する際、filenameを設定するよう修正しています。
+ def prepare_erb(content) + erb = ERB.new(content) + erb.filename = @file + erb + end + def render(content) context = ActiveRecord::FixtureSet::RenderContext.create_subclass.new - ERB.new(content).result(context.get_binding) + prepare_erb(content).result(context.get_binding) end
ファイル名の情報が無いと、fixture内にDebuggerのブレークポイントを指定しても、ストップしてくれない為との事です。
Make to private the visibility of _quote and _type_cast
Active Recordの修正です。
各adapterクラスに直接定義されていた_quote、_type_castメソッドを別module(Quoting)に切り出しいます。合わせて、メソッドをprivateにしています。