Skip to content

Handles case if object no longer exists.#12

Open
jonathanng wants to merge 1 commit intoEvilFaeton:masterfrom
jonathanng:patch-1
Open

Handles case if object no longer exists.#12
jonathanng wants to merge 1 commit intoEvilFaeton:masterfrom
jonathanng:patch-1

Conversation

@jonathanng
Copy link
Copy Markdown

Handles case if object no longer exists.

Handles case if object no longer exists.
@jonathanng jonathanng changed the title Update update_index.rb Handles case if object no longer exists. Jul 13, 2014
@tmaier
Copy link
Copy Markdown

tmaier commented Jul 28, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants