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
56477408
Commit
56477408
authored
Jan 19, 2009
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Procs are working inside geomety specifications again.
parent
75d10b91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
lib/paperclip/attachment.rb
+3
-0
test/attachment_test.rb
+18
-0
No files found.
lib/paperclip/attachment.rb
View file @
56477408
...
...
@@ -303,6 +303,9 @@ module Paperclip
:convert_options
=>
extra_options_for
(
name
)
}.
merge
(
@styles
[
name
])
end
if
@styles
[
name
][
:geometry
].
respond_to?
(
:call
)
@styles
[
name
][
:geometry
]
=
@styles
[
name
][
:geometry
].
call
(
instance
)
end
end
end
...
...
test/attachment_test.rb
View file @
56477408
...
...
@@ -170,6 +170,24 @@ class AttachmentTest < Test::Unit::TestCase
end
end
geometry_specs
=
[
[
lambda
{
|
z
|
"50x50#"
},
:png
],
lambda
{
|
z
|
"50x50#"
},
{
:geometry
=>
lambda
{
|
z
|
"50x50#"
}
}
]
geometry_specs
.
each
do
|
geometry_spec
|
context
"An attachment geomtry like
#{
geometry_spec
}
"
do
setup
do
rebuild_model
:styles
=>
{
:normal
=>
geometry_spec
}
@attachment
=
Dummy
.
new
.
avatar
end
should
"have the correct geometry"
do
assert_equal
"50x50#"
,
@attachment
.
styles
[
:normal
][
:geometry
]
end
end
end
context
"An attachment with both 'normal' and hash-style styles"
do
setup
do
rebuild_model
:styles
=>
{
...
...
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