thoughtbot/paperclip — pull request #1357 by kashif-umair (2013-10-08 13:27:21+00:00)
Title: added unit option in validator and removed duplicate error messages

### FIX No 1:
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
```

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

### Fix No 2:
This fix can be better explained in code so I'm commenting the issue there at line number 25 of `attachment_size_validator.rb`