Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
16d59f99
Commit
16d59f99
authored
Jan 05, 2012
by
Alexey Mahotkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewording comments
parent
c34a9fb6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
lib/paperclip.rb
+9
-9
No files found.
lib/paperclip.rb
View file @
16d59f99
...
...
@@ -49,7 +49,7 @@ require 'cocaine'
module
Paperclip
class
<<
self
# Provides configurability to Paperclip. The
re 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
# an uploaded image. Defaults to true.
# * log: Logs progress to the Rails log. Uses ActiveRecord's logger, so honors
...
...
@@ -179,9 +179,9 @@ module Paperclip
end
end
rescue
ArgumentError
=>
e
# Sadly, we need to capture Argu
e
mentError here because Rails 2.3.x
# Active
Support dependency's
management will try to the constant inherited
# from Object, and fail misably with "Object is not missing constant X" error
# Sadly, we need to capture ArgumentError here because Rails 2.3.x
# Active
Support dependency
management will try to the constant inherited
# from Object, and fail mis
er
ably with "Object is not missing constant X" error
# https://github.com/rails/rails/blob/v2.3.12/activesupport/lib/active_support/dependencies.rb#L124
if
e
.
message
=~
/is not missing constant/
raise
NameError
,
"uninitialized constant
#{
class_name
}
"
...
...
@@ -360,8 +360,8 @@ module Paperclip
# * +less_than+: equivalent to :in => 0..options[:less_than]
# * +greater_than+: equivalent to :in => options[:greater_than]..Infinity
# * +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
# be run i
s
this lambda or method returns true.
# * +if+: A lambda or name of a
n instance method
. Validation will only
# be run i
f
this lambda or method returns true.
# * +unless+: Same as +if+ but validates if lambda or method returns false.
def
validates_attachment_size
name
,
options
=
{}
min
=
options
[
:greater_than
]
||
(
options
[
:in
]
&&
options
[
:in
].
first
)
||
0
...
...
@@ -389,7 +389,7 @@ module Paperclip
# Places ActiveRecord-style validations on the presence of a file.
# Options:
# * +if+: A lambda or name of a
method on the instance
. Validation will only
# * +if+: A lambda or name of a
n instance method
. Validation will only
# be run if this lambda or method returns true.
# * +unless+: Same as +if+ but validates if lambda or method returns false.
def
validates_attachment_presence
name
,
options
=
{}
...
...
@@ -408,13 +408,13 @@ module Paperclip
# assigned. The possible options are:
# * +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
# noted that Internet Explorer upload files with content_types that you
# noted that Internet Explorer upload
s
files with content_types that you
# 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
# match. Allows all by default.
# * +message+: The message to display when the uploaded file has an invalid
# content type.
# * +if+: A lambda or name of a
method on the instance
. Validation will only
# * +if+: A lambda or name of a
n instance method
. Validation will only
# be run is this lambda or method returns true.
# * +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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment