I need to skip the validation on create method.I am using Rails 4 and ruby 2
i have tried like this
@model.save(:validate => false)
it not working
Rails validation defines valid states for each of your Active Record model classes. They are used to ensure that only valid details are entered into your database. Rails make it easy to add validations to your model classes and allows you to create your own validation methods as well.
Assuming you are talking about ActiveRecord
; In Rails 3 and 4 the way to skip validations and potentially persist invalid objects is as you describe:
@model.save(:validate => false)
In Rails 2 you'd need to do
@model.save(false)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With