Commit 16d59f99 by Alexey Mahotkin

Rewording comments

parent c34a9fb6
...@@ -49,7 +49,7 @@ require 'cocaine' ...@@ -49,7 +49,7 @@ require 'cocaine'
module Paperclip module Paperclip
class << self class << self
# Provides configurability to Paperclip. There are a number of options available, such as: # Provides configurability to Paperclip. The options available are:
# * whiny: Will raise an error if Paperclip cannot process thumbnails of # * whiny: Will raise an error if Paperclip cannot process thumbnails of
# an uploaded image. Defaults to true. # an uploaded image. Defaults to true.
# * log: Logs progress to the Rails log. Uses ActiveRecord's logger, so honors # * log: Logs progress to the Rails log. Uses ActiveRecord's logger, so honors
...@@ -179,9 +179,9 @@ module Paperclip ...@@ -179,9 +179,9 @@ module Paperclip
end end
end end
rescue ArgumentError => e rescue ArgumentError => e
# Sadly, we need to capture ArguementError here because Rails 2.3.x # Sadly, we need to capture ArgumentError here because Rails 2.3.x
# Active Support dependency's management will try to the constant inherited # ActiveSupport dependency management will try to the constant inherited
# from Object, and fail misably with "Object is not missing constant X" error # from Object, and fail miserably with "Object is not missing constant X" error
# https://github.com/rails/rails/blob/v2.3.12/activesupport/lib/active_support/dependencies.rb#L124 # https://github.com/rails/rails/blob/v2.3.12/activesupport/lib/active_support/dependencies.rb#L124
if e.message =~ /is not missing constant/ if e.message =~ /is not missing constant/
raise NameError, "uninitialized constant #{class_name}" raise NameError, "uninitialized constant #{class_name}"
...@@ -360,8 +360,8 @@ module Paperclip ...@@ -360,8 +360,8 @@ module Paperclip
# * +less_than+: equivalent to :in => 0..options[:less_than] # * +less_than+: equivalent to :in => 0..options[:less_than]
# * +greater_than+: equivalent to :in => options[:greater_than]..Infinity # * +greater_than+: equivalent to :in => options[:greater_than]..Infinity
# * +message+: error message to display, use :min and :max as replacements # * +message+: error message to display, use :min and :max as replacements
# * +if+: A lambda or name of a method on the instance. Validation will only # * +if+: A lambda or name of an instance method. Validation will only
# be run is this lambda or method returns true. # be run if this lambda or method returns true.
# * +unless+: Same as +if+ but validates if lambda or method returns false. # * +unless+: Same as +if+ but validates if lambda or method returns false.
def validates_attachment_size name, options = {} def validates_attachment_size name, options = {}
min = options[:greater_than] || (options[:in] && options[:in].first) || 0 min = options[:greater_than] || (options[:in] && options[:in].first) || 0
...@@ -389,7 +389,7 @@ module Paperclip ...@@ -389,7 +389,7 @@ module Paperclip
# Places ActiveRecord-style validations on the presence of a file. # Places ActiveRecord-style validations on the presence of a file.
# Options: # Options:
# * +if+: A lambda or name of a method on the instance. Validation will only # * +if+: A lambda or name of an instance method. Validation will only
# be run if this lambda or method returns true. # be run if this lambda or method returns true.
# * +unless+: Same as +if+ but validates if lambda or method returns false. # * +unless+: Same as +if+ but validates if lambda or method returns false.
def validates_attachment_presence name, options = {} def validates_attachment_presence name, options = {}
...@@ -408,13 +408,13 @@ module Paperclip ...@@ -408,13 +408,13 @@ module Paperclip
# assigned. The possible options are: # assigned. The possible options are:
# * +content_type+: Allowed content types. Can be a single content type # * +content_type+: Allowed content types. Can be a single content type
# or an array. Each type can be a String or a Regexp. It should be # or an array. Each type can be a String or a Regexp. It should be
# noted that Internet Explorer upload files with content_types that you # noted that Internet Explorer uploads files with content_types that you
# may not expect. For example, JPEG images are given image/pjpeg and # may not expect. For example, JPEG images are given image/pjpeg and
# PNGs are image/x-png, so keep that in mind when determining how you # PNGs are image/x-png, so keep that in mind when determining how you
# match. Allows all by default. # match. Allows all by default.
# * +message+: The message to display when the uploaded file has an invalid # * +message+: The message to display when the uploaded file has an invalid
# content type. # content type.
# * +if+: A lambda or name of a method on the instance. Validation will only # * +if+: A lambda or name of an instance method. Validation will only
# be run is this lambda or method returns true. # be run is this lambda or method returns true.
# * +unless+: Same as +if+ but validates if lambda or method returns false. # * +unless+: Same as +if+ but validates if lambda or method returns false.
# NOTE: If you do not specify an [attachment]_content_type field on your # NOTE: If you do not specify an [attachment]_content_type field on your
......
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