Rails 3 skip validations and callbacks

前端 未结 9 1704
野的像风
野的像风 2020-12-07 23:58

I have a particularly complex model with validations and callbacks defined. The business needs now calls for a particular scenario where adding a new record requires skippin

9条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 00:24

    None of these will work if your validations are written into the database itself.

    +------------------------------------+--------------------------------------------------+------+-----+--------------------+----------------+
    | Field                              | Type                                             | Null | Key | Default            | Extra          |
    +------------------------------------+--------------------------------------------------+------+-----+--------------------+----------------+
    | status                             | enum('Big','Small','Ugly','Stupid','Apologetic') | NO   |     | Stupid             |                |
    

提交回复
热议问题