Skip to content

Commit

Permalink
Update the documentation to say that we require the virtual attribute…
Browse files Browse the repository at this point in the history
… to be defined in order to use the validation.
  • Loading branch information
sikachu committed Jul 7, 2011
1 parent 0362b9e commit acf957c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/paperclip.rb
Expand Up @@ -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
Expand Down

0 comments on commit acf957c

Please sign in to comment.