I'm really really new to rails. I haven't really written any custom validation methods and I was wondering if one exists for this or if I should write my own.
I have a boolean value for images that says whether it's featured or not. How would I validate upon creating new entries and editing that there aren't more than a given number of featured photos? I'd want it to throw an error if I already have say, 10 photos flagged, and a user tries to flag another one. Thanks