2016/02/24分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
actionmailer/CHANGELOG.md
- Alias
rakewithrails_commandin the Rails Application Templates API following Rails 5 convention of preferring "rails" to "rake" to run tasks. - Generate applications with an option to log to STDOUT in production using the environment variable
RAILS_LOG_TO_STDOUT.
Make sure we don't change the global state in the tests
activerecord/test/cases/migration_test.rbの修正です。
テスト内で作成したのに、その後削除してないテーブルがあったので、削除するよう修正しています。
Add client-side console logging to help debug reconnect issues
actioncable/app/assets/javascripts/action_cable/connection.coffee、
actioncable/app/assets/javascripts/action_cable/connection_monitor.coffeeの修正です。
各event実行時に、console.logでデバッグログを出力するよう修正しています。
クライアントの再接続処理で問題があり、その確認用のログとの事です。
Treat 'closing' state as closed.
actioncable/app/assets/javascripts/action_cable/connection.coffeeの修正です。
close状態かどうかをチェックする為のメソッド(isClosed)を追加しています。
Confirm connection monitor subscription on open
actioncable/lib/action_cable/connection/base.rbの修正です。
サーバサイドでconnetionをopenする際、内部で保持しているconnection monitor channelに確認用メッセージを送信するよう修正しています。
WebSocketとの接続に成功した際にconnection monitorの状態をリセットする為に必要との事です。
actioncable/app/assets/javascripts/action_cable/connection_monitor.coffeeの修正です。
connection monitor接続時にデバッグログを出力するよう修正しています。
actioncable/app/assets/javascripts/action_cable/connection.coffeeの修正です。
connectionが生きてるかどうか確認する為のConnection#isAliveメソッドを追加し、接続確認にそちらのメソッドを使用するよう修正しています。
Uninstall event handlers when replacing WebSocket instance
actioncable/app/assets/javascripts/action_cable/connection.coffeeの修正です。
WebSocketのインスタンスを再生成する際、既にWebSocketのインスタンスがいる場合に、そのWebSocketのインスタンスに対して終了処理(onClose)を実行するよう修正しています。
Action Cableのクライアントサイドの修正です。
デバッグログログを出力するのにconsole.logを使用していたのを、Action Cable内にデバッグログを出力する為のメソッド(ActionCable.log)を追加し、そちらを使用するよう修正しています。
合わせて、デバッグログの出力するかどうかを切り替える為のメソッド(ActionCable.startDebugging /ActionCable.stopDebugging)を追加し、startDebugging`した時のみデバッグログを出力するようにしています。
Fix isAlive condition and add more logging
actioncable/app/assets/javascripts/action_cable/connection.coffeeの修正です。
Connection#isAliveメソッドでWebSocketのインスタンスが存在するかどうかをチェックするよう修正しています。
reestablish previous connection after creating all databases
`activerecord/lib/active_record/tasks/database_tasks.rb@の修正です。。
create_allメソッドでdatabaseを作成後にconnectionを再接続するよう修正しています。
databaseの作成処理はconnection poolを変異してしまうので、既にconnectionを保持していてもそのconnectionは使用出来なくなってしまうので、再接続するよう修正したとの事です。rails db:drop:all db:create:all db:migrateのように、database 削除 / 作成等を同時に実行した場合に問題になってしまっていたとの事でした。
Merge pull request #23628 from maclover7/fix-23625
activerecord/lib/active_record/validations/uniqueness.rbの修正です。
primary keyにid以外のカラム名(uuid等)を使用、かつ、primary keyにvalidates_uniqueness_ofを指定した場合に、更新処理時に値はユニークなのにユニークではないと誤検出されてしまうバグがあったのを修正しています。
clear digest cache between tests
actionview/test/template/digestor_test.rbの修正です。
テストの前処理で、digest cacheをクリアするよう修正しています。
Merge pull request #23734 from schneems/schneems/stdout-again
railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.ttの修正です。
envにRAILS_LOG_TO_STDOUTが設定されている場合、stdoutにログを出力するようデフォルトのenvvironmentファイルに設定を追加しています。
+ if ENV["RAILS_LOG_TO_STDOUT"].present? + config.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) + end
んー、いるかなあ…。
Revert changes to validations from PR #18612
associationを使用している場合に、既に存在している子のレコードを親に指定して親をsaveした場合に、 子の値が一切変更になってないにも関わらず、不要なvalidation処理が実行されてしまうバグがあったのを修正した、 Fix validations on child record when record parent has validate: falseをrevertしています。
既存の処理を壊してしまう(valid? / invalid?が正しく動作しない場合がある)、かつ対応に時間が掛かりそうな為、revertしたようです。
Fix request.ssl? bug with Action Cable
actionpack/lib/action_dispatch/http/request.rbの修正です。
Request#ssl?メソッドでschemeがwssの場合もtrueを返すよう修正しています。
WebSocketの場合、セキュアなプロトコルはwssだからですね。
Switch to data-turbolinks-track="reload"
rails guideのThe Asset Pipeline及びrailtiesの修正です。
"data-turbolinks-track" => trueを使用していた箇所を、`"data-turbolinks-track" => "reload"に修正しています。
Turbolinks 5でAPIが変わった為。
New apps get the Turbolinks beta gem
railties/lib/rails/generators/app_base.rbの修正です。
rails newした際に作成するGemfileに記載するTurbolinksのバージョンに~> 5.0.0.betaを指定するよう修正しています。
Update to the latest Turbolinks gems
Gemfile.lockの修正です。
Turbolinks 5.0.0.beta2を使用するようGemfile.lockを更新しています。
Update JavaScript guide for Turbolinks 5
rails guideのWorking with JavaScript in Railsの修正です。
Turbolinks 5のAPIの変更に合わせて、guide内の説明を更新しています。
Porting ActionController::Caching to ActionMailer::Caching
Action Mailerの修正です。ActionController::Caching module及びActionMailer::Caching::Fragment moduleをまるまるAction Mailer配下にコピーしてきます。
Action Mailerのviewでもview cacheを使用出来るよう対応を行っており、その対応の為です。以降関連コミットが続きます。
Move caching/fragments in ActionMailer and ActionController to action_dispatch/caching/fragments
ActionController::Caching::Fragment moduleをActionDispatch::Caching::Fragmentに移動して、Action Controller / Action Mailer両方でそのmoduleを使用するよう修正しています。
ACtionMailer::Caching、ActionController::Cachingそれぞれで行っていた処理で、共通で使用出来るメソッドをごっそりActionDispatch::Caching` moduleに移動し、そちらを使用するよう修正しています。
Make caching configuration more flexible
instrument_fragment_cacheメソッドをAction Mailer / Action Controller共通で使用出来るようにする為に、instrumentを返すメソッド名をそれぞれのコンポーネントで同じ名前にするよう修正しています。
Move ActionMailer::Caching's content into ActionMailer::Base instead of including it
ActionMailer::Cachingで行っていた処理をActionMailer::Baseに移動し、ActionMailer::Caching moduleは削除しています。
Remove unnecessarily included modules in ActionController::Caching
actionpack/lib/action_controller/caching.rbの修正です。
使用していないmoduleのincludeを削除しています。
Change ActionMailer's default caching configuration and update generator's environment templates
Action Mailer / railtiesの修正です。
Action Mailerのperform_cachingのデフォルトをfalseに変更、及びrails newで生成するデフォルトのenvironmentsファイルにconfig.action_mailer.perform_cachingの設定を追加しています。
Move Caching module to Abstract Controller
ActionDispatchで行っていたcaching処理を、Abstract Controllerに移動しています。
Abstract Controller は Action Mailer と Action Controllerで共通のコンポーネントな為、共通する処理を定義するには、Abstract Controllerが適切な為、との事です。
Fix assert_nothing_raised deprecation warning format
activesupport/lib/active_support/test_case.rbの修正です。
assert_nothing_raisedに引数を指定した際に出力するdeprecate メッセージから、不要な空白を削除しています。
# Before:
DEPRECATION WARNING: Passing arguments to assert_nothing_raised
is deprecated and will be removed in Rails 5.1.
# After: DEPRECATION WARNING: Passing arguments to assert_nothing_raised is deprecated and will be removed in Rails 5.1.
Merge pull request #23837 from mgroeneman/fix-form-helper-guide-typo
rails guideのForm Helpersの修正です。
side effectsをside-affectsにタイポしている箇所があったのを修正しています。
[ci skip] Improve the readability of documents of nested_attributes
activerecord/lib/active_record/nested_attributes.rbのdocの修正です。
nested_attributesメソッドのdoc内のexampleコードのインデント、空白がおかしな事になっていたのを、整えています。
before

after

drop_table :test_text_limits as well
activerecord/test/cases/migration_test.rbの修正です。
テスト内で作成したのに、その後削除してないテーブルがあったので、削除するよう修正しています。
Use the trick to get beta releases in the Gemfile
railties/lib/rails/generators/app_base.rbの修正です。
Gemfileに記載するTurbolinksのバージョンを"~> 5.x"に修正しています。バージョン変わる毎に修正しないで済むように、ですね。
Move private methods to the private visibility
actionmailer/lib/action_mailer/base.rb、
actionpack/lib/action_controller/caching.rbの修正です。
rails内部でしか使用しないメソッドについて、private配下に移動しています。
Add changelog entry for #22825
actionmailer/CHANGELOG.mdの修正です。
先のAction Mailerでview cacheを使用出来るようにした対応について、CHANGELOGにentryを追加しています。
Merge pull request #20851 from tomprats/indifferent-sessions
actionpack/lib/action_controller/test_case.rb、
actionpack/lib/action_dispatch/request/session.rbの修正です。
sessionをHashで管理していたのを、HashWithIndifferentAccessで管理するよう修正しています。
session[:deep][:hash] = "Magic" session[:deep][:hash] == "Magic" session[:deep]["hash"] == "Magic"
Show permitted flag in the output of AC::Parameters#inspect
actionpack/lib/action_controller/metal/strong_parameters.rbの修正です。
ActionController::Parameters#inspectメソッドでpermitted flagの値も表示するよう修正しています。
# Before: a = ActionController::Parameters.new(foo: 'bar') # => <ActionController::Parameters {"foo"=>"bar"}> # After: a = ActionController::Parameters.new(foo: 'bar') # => <ActionController::Parameters {"foo"=>"bar"} permitted: false> a.permit(:foo) # => <ActionController::Parameters {"foo"=>"bar"} permitted: true>
Merge pull request #23795 from claudiob/replace-rack-with-rails-command
railtiesの修正です。
Rails Application Templates APIでrails_commandメソッドを使用できるよう修正しています。実体はただのrakeメソッドのaliasです。
generate(:scaffold, "person name:string") route "root to: 'people#index'" rails_command("db:migrate") after_bundle do git :init git add: "." git commit: %Q{ -m 'Initial commit' } end
Rails 5でrailsコマンドでrakeのタスクを実行出来るようにしたのに合わせて、との事です。
Ignore callstacks from Ruby stdlib in deprecation
activesupport/lib/active_support/deprecation/reporting.rbの修正です。
deprecationメッセージでcallstacksを表示する際、Ruby stdlibのstackは無視するよう修正しています。
Always use the released coffee-rails in new applications
railties/lib/rails/generators/app_base.rbの修正です。
rails newした際に作成するGemfileに記載するcoffee-railsを、githubのmasterではなく、リリース済みのgemを使用するよう修正しています。
coffee-railsは安定しており、もうmasterを使用する必要は無い為、との事です。
Merge pull request #23616 from piotrj/issue_23609_logger_broadcast_silencing
Active Supportの修正です。
broadcasted loggersでloggerのsilence処理が正しく動作しないバグがあったのを修正しています。broadcast用moduleでlocal_levelを考慮してなかったのが問題だったようです、log_levelのハンドリング処理追加して対応しています。
activesupport/lib/active_support/logger_thread_safe_level.rbの修正です。
Rails内部でのみ使用するメソッドに:nodoc:を追加しています。
No need CHANGELOG entry for #23849.
actionpack/CHANGELOG.mdの修正です。
CHANGELOGから、ActionController::Parameters#inspectメソッドでpermitted flagの値も表示するよう修正した対応のentryを削除しています。
新しい機能でもbug fixの対応でも無い為、CHANGELOGへの記載は不要だろう、という事で削除されたようです。
Add CHANGELOG for https://github.com/rails/rails/pull/23734 [ci skip]
railties/CHANGELOG.mdの修正です。
envにRAILS_LOG_TO_STDOUTが設定されている場合、stdoutにログを出力するよう対応した、Merge pull request #23734 from schneems/schneems/stdout-againの対応についてCHANGELOGにentryを追加しています。
Remove changelog entry for reverted commit
activerecord/CHANGELOG.mdの修正です。
Fix validations on child record when record parent has validate: falseをrevertした(Revert changes to validations from PR #18612際、CHANGELOGからentryの削除が漏れてしまっていたので、CHANGELOGから該当のentryを削除しています。
:bomb: run the test @rafaelfranca :angry:
activesupport/lib/active_support/deprecation/reporting.rbの修正です。
_extract_callstackメソッド内で参照する変数名をタイポしている箇所があったのを修正しています。
Ensure drop_table even if tests failure or interrupted
activerecord/test/cases/migration_test.rbの修正です。
テストで作成したテーブルをdropする処理を、ensure内で実行し、テストが失敗した際も必ずdrop処理が行われるよう修正しています。