Skip to content

Instantly share code, notes, and snippets.

@alexbartlow
Created November 23, 2010 18:49
Show Gist options
  • Select an option

  • Save alexbartlow/712279 to your computer and use it in GitHub Desktop.

Select an option

Save alexbartlow/712279 to your computer and use it in GitHub Desktop.
class ActiveRecord::Base
def self.find_by_id(id)
find(id)
rescue ActiveRecord::RecordNotFound
nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment