Reputation: 77
I'm new to Ruby on Rails and I'm currently working on models. I have added a new validation to pre created attribute.
This is the validation that I have added.
validates_presence_of :services, :message => 'This field is non-editable'
Do I have to migrate the changes after adding validation? If yes then how?
Any kind of help would be greatly appreciated.
Upvotes: 0
Views: 363
Reputation: 1722
Records already in your database won't be affected. But it you edit a previous record, you won't be able to store it without passing the validation.
You've 3 options:
Upvotes: 2