5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ActiveJobでとりあえず全部の例外を補足する

Last updated at Posted at 2016-11-26

Active Job の基礎 | Rails ガイドだと

class GuestsCleanupJob < ActiveJob::Base
  queue_as :default

  rescue_from(ActiveRecord::RecordNotFound) do |exception|
    # ここに例外処理を書く
  end

  def perform
    # 後で実行する処理を書く
  end
end

となっているが、ActiveRecord::RecordNotFoundStandardErrorにすれば良い。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?