Commit 37e41856 by Adam Steel Committed by Jon Yurek

Adds AttachmentSizeValidator usage example.

Syntax is not clear from current documentation.
parent 07e0330e
...@@ -226,6 +226,8 @@ Example Usage: ...@@ -226,6 +226,8 @@ Example Usage:
```ruby ```ruby
validates :avatar, :attachment_presence => true validates :avatar, :attachment_presence => true
validates_with AttachmentPresenceValidator, :attributes => :avatar validates_with AttachmentPresenceValidator, :attributes => :avatar
validates_with AttachmentSizeValidator, :attributes => :avatar, :less_than => 1.megabytes
``` ```
Validators can also be defined using the old helper style: Validators can also be defined using the old helper style:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment