Two ways to do that (but there are many more you could find).
If your target table matches an ActiveRecord model, you could use a before_write instead of a destination, put the validation in your model, and do:
before_write do |row|
MyModel.new(row).save!
row
end
so that an error is raised.
Alternatively, you can use whatever verification directly on the rows yourself and raise error accordingly. This is especially useful if you don't use AR as the target, or if you want more complicated validations than AR perform, or if you want to skip AR validations because they become a performance bottleneck.
before_write do |row|
raise "Value #{row[:field]} is not a number!" unless ....
row
end
hope this helps,
Thibaut
--