Faça um campo opcional em trilhos

Eu uso o clipe de papel para anexar um avatar aos usuários, o que funciona bem, mas quando um novo usuário tenta registrá-lo, reclama que o avatar é muito pequeno e não do tipo certo.

É assim que eu valido meus avatares:

validates_attachment_size :avatar, :less_than => 1.megabytes
validates_attachment_content_type :avatar, :content_type => ['image/jpeg', 'image/png', 'image/gif']

Este é o erro que recebo quando tento me registrar.

There were problems with the following fields:

* Avatar file size file size must be between 0 and 1048576 bytes.
* Avatar content type is not included in the list

Existe alguma maneira de fazer com que o avatar fique em branco?

questionAnswers(3)

yourAnswerToTheQuestion