Browse files

Update the documentation to say that we require the virtual attribute…

… to be defined in order to use the validation.
  • Loading branch information...
1 parent 0362b9e commit acf957c43c28ebcb54ac183bc7ae1d8dc284718d @sikachu sikachu committed Jul 1, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/paperclip.rb
@@ -351,6 +351,8 @@ def validates_attachment_presence name, options = {}
# NOTE: If you do not specify an [attachment]_content_type field on your
# model, content_type validation will work _ONLY upon assignment_ and
# re-validation after the instance has been reloaded will always succeed.
+ # You'll still need to have a virtual attribute (created by +attr_accessor+)
+ # name +[attachment]_content_type+ to be able to use this validator.
def validates_attachment_content_type name, options = {}
validation_options = options.dup
allowed_types = [validation_options[:content_type]].flatten

0 comments on commit acf957c

Please sign in to comment.