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
a93dfc77
Commit
a93dfc77
authored
Mar 04, 2014
by
Johan van Zonneveld
Committed by
Jon Yurek
Mar 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return name of style in processor_options
parent
94a1154e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
lib/paperclip/style.rb
+1
-1
test/style_test.rb
+5
-0
No files found.
lib/paperclip/style.rb
View file @
a93dfc77
...
@@ -71,7 +71,7 @@ module Paperclip
...
@@ -71,7 +71,7 @@ module Paperclip
# Arguments other than the standard geometry, format etc are just passed through from
# Arguments other than the standard geometry, format etc are just passed through from
# initialization and any procs are called here, just before post-processing.
# initialization and any procs are called here, just before post-processing.
def
processor_options
def
processor_options
args
=
{}
args
=
{
:style
=>
name
}
@other_args
.
each
do
|
k
,
v
|
@other_args
.
each
do
|
k
,
v
|
args
[
k
]
=
v
.
respond_to?
(
:call
)
?
v
.
call
(
attachment
)
:
v
args
[
k
]
=
v
.
respond_to?
(
:call
)
?
v
.
call
(
attachment
)
:
v
end
end
...
...
test/style_test.rb
View file @
a93dfc77
...
@@ -31,6 +31,10 @@ class StyleTest < Test::Unit::TestCase
...
@@ -31,6 +31,10 @@ class StyleTest < Test::Unit::TestCase
assert_equal
[
:thumbnail
],
@style
[
:processors
]
assert_equal
[
:thumbnail
],
@style
[
:processors
]
assert_equal
"100x100#"
,
@style
[
:geometry
]
assert_equal
"100x100#"
,
@style
[
:geometry
]
end
end
should
"return the name of the style in processor options"
do
assert_equal
:foo
,
@style
.
processor_options
[
:style
]
end
end
end
context
"A style rule with properties supplied as procs"
do
context
"A style rule with properties supplied as procs"
do
...
@@ -67,6 +71,7 @@ class StyleTest < Test::Unit::TestCase
...
@@ -67,6 +71,7 @@ class StyleTest < Test::Unit::TestCase
@attachment
=
attachment
:path
=>
":basename.:extension"
,
@attachment
=
attachment
:path
=>
":basename.:extension"
,
:styles
=>
styles
:styles
=>
styles
end
end
should
"have the right number of styles"
do
should
"have the right number of styles"
do
assert_kind_of
Hash
,
@attachment
.
styles
assert_kind_of
Hash
,
@attachment
.
styles
assert_equal
3
,
@attachment
.
styles
.
size
assert_equal
3
,
@attachment
.
styles
.
size
...
...
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