views:

12

answers:

0

Is it possible to use rescue_from in an ActiveRecord Model? This doesn't seem to work:

class Book < ActiveRecord::Base
    include ActiveSupport::Rescuable
    rescue_from ActiveRecord::StatementInvalid do |exception|
      # something here
    end

The code executes, but the StatementInvalid error is still raised

Any ideas?