tire_async_index icon indicating copy to clipboard operation
tire_async_index copied to clipboard

Handles case if object no longer exists.

Open jonathanng opened this issue 11 years ago • 1 comments

Handles case if object no longer exists.

jonathanng avatar Jul 11 '14 17:07 jonathanng

First of all it's not a good Idea to simply catch all exceptions. I guess your problem is related to ActiveRecord.find raising an error in case of an error.

I add the following method to my model:

  def self.tire_async_finder(id)
    find_by(id: id)
  end

find_by returns nil when not found.

tmaier avatar Jul 28 '14 12:07 tmaier