# How to disable validation during a migration

**URL:** <https://www.ruby-forum.com/t/how-to-disable-validation-during-a-migration/108316>\
**Category:** Rails\
**Created:** [July 2, 2007, 6:52am UTC](https://www.ruby-forum.com/t/how-to-disable-validation-during-a-migration/108316 "2007-07-02T06:52:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e480ec/32.png) [@mikel](https://www.ruby-forum.com/u/mikel)\
**Post date:** [July 2, 2007, 6:52am UTC](https://www.ruby-forum.com/t/how-to-disable-validation-during-a-migration/108316/1 "2007-07-02T06:52:49Z")

</div>

I have a migration I am doing which involves a change in column name  
that my model uses for validation.

Part of the migration is changing data in that column, which would  
fail the validation, but will pass the new validation.

Is there anyway I can “turn off validation” inside the migration for  
the duration of the migration?

I have worked around it… but would be good to know for future ref.

Thanks

Mikel

---

<div class="post-metadata">

**Author:** ![mikel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e480ec/32.png) [@mikel](https://www.ruby-forum.com/u/mikel)\
**Post date:** [July 3, 2007, 12:27am UTC](https://www.ruby-forum.com/t/how-to-disable-validation-during-a-migration/108316/2 "2007-07-03T00:27:57Z")

</div>

Mikel wrote:

> I have a migration I am doing which involves a change in column name  
> that my model uses for validation.
> 
> Part of the migration is changing data in that column, which would  
> fail the validation, but will pass the new validation.
> 
> Is there anyway I can “turn off validation” inside the migration for  
> the duration of the migration?
> 
> I have worked around it… but would be good to know for future ref.

I’m not sure I understand the question, but you can always say…

whatever.save\_with\_validation(false)

…to skip validation.

–Al Evans
