Given this:
class User < ActiveRecord::Base
has_many :photos
MAX_PHOTOS = 5
validate :quantity_of_photos
def quantity_of_photos
???
end
end
And this:
@user.photos.size # => 5
I need this to fail:
@user.photos << Photo.create(valid_photo_attributes)
How do I do this validation?