Zouplaz wrote:
> Hello, I've seen there is a retry statement that rerun the entire
> begin/end block which raised the exception...
> 
> I wonder if there is a way to 'continue' (from the rescue block) with
> the next statement following the one which raised the exception.

I try this in the "script/console" of my project and works:

["telefono","escritorio","sillones","sillas","sillones","cajas","modulares","archivos"].each 
do |title|
  begin
    p = Product.new(:title => title)
    p.save!
  rescue ActiveRecord::RecordInvalid => e
    #maybe collect errors
    next
  end
end

Juan Matias

-- 
Posted via http://www.ruby-forum.com/.