Model Validation for record creation in rails
- by Elliot
Hey Guys,
Lets say the model for books is:
created_at
user_id (int)
author_id (int)
genre_id (int)
pages (int)
I want to let people change the "created_at" field upon record creation. I also want to make sure that a record can't have the exact same created_at, user_id, and author_id as any other record (i.e. each needs its own date).
Whats the best to perform this type of validation, and how should I go about doing it?
Best,
Elliot