2017/07/24分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Use frozen string literal in actionmailer/
Action Mailerの修正です。
各ファイルの先頭にfrozen_string_literal: trueを追加しています。
Make actionview ready for frozen strings
actionview/lib/action_view/renderer/streaming_template_renderer.rbの修正です。
ファイルの先頭にfrozen_string_literal: trueを追加、及び、Stringを変更する箇所でdupを呼び出すよう修正しています。
Make actioncable ready for frozen strings
actioncable/lib/action_cable/channel/base.rbの修正です。
ファイルの先頭にfrozen_string_literal: trueを追加、及び、Stringを変更する箇所でdupを呼び出すよう修正しています。
Use frozen string literal in actioncable/
Action Cableの修正です。
各ファイルの先頭にfrozen_string_literal: trueを追加しています。
Merge pull request #29860 from georgeclaghorn/travel-back-automatically
activesupport/lib/active_support/testing/time_helpers.rbの修正です。
TimeHelpers moduleでafter_teardownメソッドを定義し、テスト終了時に自動でtravel_backを呼び出すよう修正しています。
これにより、block無しのtravelやtravel_toを使用した場合に、明示的にtravel_backを呼ぶ必要は無くなります。 Remove automatic removal of Date/Time stubs after each test caseで一度同様の対応が削除された事があったのですが、自動でtravel_backした方が便利だろう、という事で再度入ったようです。
document metadata support added to message encryptor and message verifier
activesupport/lib/active_support/message_encryptor.rb、
activesupport/lib/active_support/message_verifier.rbのdocの修正です。
ActiveSupport::MessageEncryptorクラス、ActiveSupport::MessageVerifierクラスのdocにpurposeオプションやメッセージにexpireを設定する場合の方法についてのドキュメントを追加しています。
add to changelog: purpose and expiry support
MessageVerifierとMessageEncryptorにpurposeやexpires_in、expires_atオプションを設定出来るようにした対応(Add purpose and expiry to messages encrypted using Message EncryptorとAdd Expiry & Purpose to Message Verifier)についてエントリーを追加しています。
purposeオプションはメッセージの生成時 / 確認時に指定する事が出来、purposeの値が一致しないと、メッセージの確認が出来ないようになっています。
token = @verifier.generate("this is the chair", purpose: :login) @verifier.verified(token, purpose: :login) # => "this is the chair" @verifier.verified(token, purpose: :shipping) # => nil @verifier.verified(token) # => nil
expires_in、expires_atは名前の通りでメッセージに対してexpireする日付・期間を指定する事ができます。指定された日付を超えた場合、そのメッセージは確認出来なくなります。
[ci skip] Remove superfluous paragraphs; fully qualify constants.
activesupport/CHANGELOG.mdの修正です。
先のMessageVerifierとMessageEncryptorの対応についてのエントリーを整理しています。
add metadata tests: verify method
activesupport/test/message_verifier_test.rbの修正です。
ActiveSupport::MessageVerifier#verifyメソッドについてのテストを追加しています。
Fix test failure in message verifier tests
activesupport/test/message_verifier_test.rbの修正です。
ActiveSupport::MessageVerifierクラスのテストで現在時刻を取得するのにTime.localを使用していたのを、Time.utcを使用するよう修正しています。Time.localだとテストを実行する環境のTimezoneに結果が依存してしまい、環境によってはテストがコケてしまう為。
Fix warnings in railties tests
Gemfileの修正です。
sass-rails gemを使用するのに、リリース済みのgemではなく、GitHubのブランチを指定するよう修正しています。
リリース済みのsass-railsだとasset_data_urlの再定義に関するwarningが出てしまうのですが、上記ブランチだとその問題が解決済みな為。
Merge pull request #29894 from eugeneius/check_schema_file_dup_string
activerecord/lib/active_record/tasks/database_tasks.rbの修正です。
check_schema_fileメソッドでschema fileが存在しない場合に出力するメッセージをdupするよう修正しています。
- message = %{#{filename} doesn't exist yet. Run `rails db:migrate` to create it, then try again.} + message = %{#{filename} doesn't exist yet. Run `rails db:migrate` to create it, then try again.}.dup message << %{ If you do not intend to use a database, you should instead alter #{Rails.root}/config/application.rb to limit the frameworks that will be loaded.} if defined?(::Rails.root)
直後にmessage変数に値を追加しており、dupしないとfrozen_string_literalにtrueを指定している場合にエラーになってしまう為。
Refactor Active Record to let Arel manage bind params
Active Recordの修正です。
Active Recordで行っていたbind paramsの管理をArelで行うようリファクタリングしています。
ASTと、ASTに深く関連しているbind paramsを別に管理しようとして、コードが複雑、かつ、バグが多い状態になっていました。これを、ASTで直接bind paramsを保持するようリファクタリングし、Arel側で生成されるSQLとbind params両方を管理出来るようにした、という事のようです。多分。
その為、Arel側でも諸々修正が行われています。このあたり。
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb、
activerecord/lib/active_record/connection_adapters/mysql2_adapter.rbの修正です。
先のActive Recordのリファクタの影響でコケてしまったテストを修正しています。
Merge pull request #29905 from kamipo/remove_duplicated_assertion
activerecord/test/cases/base_test.rbの修正です。
count + joinのテストで、同じ内容のassertionがあったのを削除しています。
activerecord/lib/active_record/relation/predicate_builder.rbの修正です。
先のActive Recordのリファクタの影響でコケてしまったテストを修正しています。