way to access objects errors and halt a record from callback
charithreddyv opened this issue · 0 comments
charithreddyv commented
Hai there,
i have just started using activerecord-import i am following the way of creating a object and doing import and also setting run_callbacks
along with validate_uniqueness: true
when import fails i get an array of failed_instances
but is there is way i can access the error?
what i mean is in models before_save callback i do some checks and add error to the object like errors.add("My error")
and throw(:abort) return false
but this does not stop from Model.import to continue insert that record.
my question is, how to stop import to fail for a specific object in an array and how to show the errors that are added that model ?