thoughtbot/paperclip — pull request #1417 by kashif-umair (2014-01-14 09:31:01+00:00)
Title: Readable units

Added a unit option to `validates_attachment_size`. It will be helpful to make the size errors more readable.

Example:

```
validates_attachment_size :attachment, :less_than => 10.megabytes
```
If we upload a file greater than 10 MB, then it will add an error message like
`Attachment file size must be less than 10485760 bytes`
As you can see that the size is not very readable to the user. User has to convert it to MB or GB to understand the size limit. So after this fix you can pass a unit option to `validates_attachment_size` validation.

Example after Fix:

```
validates_attachment_size :attachment, :less_than => 10.megabytes, :unit => :mb
```

Now the user will get message something like this
`Attachment file size must be less than 10 MB`