lib/tasks/snipsnap.rake
# Find the object in the DB. Error gracefully.
Find the object in the DB. Error gracefully.
Find the object in the DB . Error gracefully .
def check_object(type, id)
  begin
    object = type.constantize.find(id)
    puts "Found #{type} #{id}!"
    return object
  rescue ActiveRecord::RecordNotFound => e
    puts e.message
    puts "Exiting..."
  end
end
def check_object ( type , id ) begin object = type . constantize . find ( id ) puts "Found #{type} #{id}!" return object rescue ActiveRecord :: RecordNotFound => e puts e . message puts "Exiting..." end end
Find the object in the DB.
Find the object in the DB .
type
id