2018/11/24分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activejob/CHANGELOG.md
- Move
ActiveRecord::StatementInvalidSQL to error property and include binds as separate error property. - Values of enum are frozen, raising an error when attempting to modify them.
activestorage/CHANGELOG.md
Keep executions for each specific exception (#34352)
activejob/lib/active_job/core.rb、
activejob/lib/active_job/exceptions.rbの修正です。
retry_onのretry回数をjobグローバルで保持していたのを、exception毎に保持するよう修正しています。
class RemoteServiceJob < ActiveJob::Base retry_on ActiveRecord::Deadlocked, attempts: 3 retry_on Net::OpenTimeout, attempts: 10 end
例えば、上記のようにretryを定義していた場合に、ActiveRecord::Deadlockedが4回おきたらraiseする(attemptsが3なので)ように見えるのですが、実際はraiseされない(その後にattempts: 10のretryが指定されており、10回までretryするようになっている)ようになっていました。
これは意図した挙動と異なるよね、という話になり、retry回数はexception毎に保持するように修正されました(上記の例の場合、ActiveRecord::Deadlockedが4回おきたら4回目はraiseされるようになった)。
Merge pull request #34468 from gmcgibbon/redact_sql_in_errors
Active Recordの修正です。
ActiveRecord::StatementInvalidでmessageにSQLがそのまま含まれていたのを、SQL(とbinds)は別のproperty(sql、binds)として管理するようにして、messageにSQLは含まないよう修正しています。
これにより、ActiveRecord::StatementInvalidを継承した独自クラスを使用している場合、ActiveRecord::StatementInvalid#initializeを呼び出す際に、(必要ならば~sqlとbindsも渡す必要があります。
class MySubclassedError < ActiveRecord::StatementInvalid def initialize(message, sql:, binds:) super(message, sql: sql, binds: binds) end end
raw SQLをエラーメッセージに含まないで欲しい、という要望があった為。
Merge pull request #34455 from minimalweb/progressive_jpeg_inclusion_as_variable_content_type
activestorage/lib/active_storage/engine.rbの修正です。
Active Storageのデフォルトのvariable content typesにprogressive JPG(image/pjpeg)を追加しています。
Merge pull request #34376 from composerinteralia/default_queue_name
activejob/lib/active_job/queue_name.rbの修正です。
queue_nameのdefaultを動的に評価(default: -> { self.class.default_queue_name })するよう修正しています。ActiveJob::Base.queue_name_prefixが指定された場合に、その値が使用されるようにする為。
rubyonrails.org has been ready for https
rails.gemspecの修正です。
homepageのURLにhttpsを使うよう修正しています。
Raises error when attempting to modify enum values
activerecord/lib/active_record/enum.rbの修正です。
enumの値をfreezeして、動的に変更しようとした場合にエラーになるよう修正しています。