Ruby on Rails - skipping validations in ruby on rails- ruby on rails tutorial - rails guides - rails tutorial - ruby rails



  • Using below methods if we want to skip the validations.These methods will save the object to the database even if it is invalid
    • decrement!
    • decrement_counter
    • increment!
    • increment_counter
    • toggle!
    • touch
    • update_all
    • update_attribute
    • update_column
    • update_columns
    • update_counters

We can also skip validation while saving by passing validate as an argument to save

User.save(validate: false)

Related Searches to Skipping validations in ruby on rails