README.md in activestorage-validator-0.1.3 vs README.md in activestorage-validator-0.1.4
- old
+ new
@@ -1,5 +1,8 @@
+[![Gem Version](https://badge.fury.io/rb/activestorage-validator.svg)](https://rubygems.org/gems/activestorage-validator)
+[![Build](https://github.com/aki77/activestorage-validator/workflows/Build/badge.svg)](https://github.com/aki77/activestorage-validator/actions)
+
# ActiveStorage Validator
ActiveStorage blob validator.
## Installation
@@ -28,9 +31,11 @@
validates :avatar, presence: true, blob: { content_type: :image } # supported options: :image, :audio, :video, :text
validates :photos, presence: true, blob: { content_type: ['image/png', 'image/jpg', 'image/jpeg'], size_range: 1..5.megabytes }
# validates :photos, presence: true, blob: { content_type: %r{^image/}, size_range: 1..5.megabytes }
end
```
+
+Note: For `has_many_attached`, size is validated on each file individually. In the code above, `:photos` validation allows any number of photos to be upload, each one being 5 MB or less in size.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/aki77/activestorage-validator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.