2018/11/24分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
activejob/CHANGELOG.md
- Move
ActiveRecord::StatementInvalid
SQL 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して、動的に変更しようとした場合にエラーになるよう修正しています。