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
35cdaa54
Commit
35cdaa54
authored
Nov 12, 2010
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests pass in Rubinius 1.1.0
parent
fa7ee7ca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
lib/paperclip/interpolations.rb
+2
-1
test/attachment_test.rb
+1
-1
No files found.
lib/paperclip/interpolations.rb
View file @
35cdaa54
...
@@ -41,8 +41,9 @@ module Paperclip
...
@@ -41,8 +41,9 @@ module Paperclip
# Returns the interpolated URL. Will raise an error if the url itself
# Returns the interpolated URL. Will raise an error if the url itself
# contains ":url" to prevent infinite recursion. This interpolation
# contains ":url" to prevent infinite recursion. This interpolation
# is used in the default :path to ease default specifications.
# is used in the default :path to ease default specifications.
RIGHT_HERE
=
"
#{
__FILE__
.
gsub
(
%r{^
\.
/}
,
""
)
}
:
#{
__LINE__
+
3
}
"
def
url
attachment
,
style_name
def
url
attachment
,
style_name
raise
InfiniteInterpolationError
if
caller
.
any?
{
|
b
|
b
.
index
(
"
#{
__FILE__
}
:
#{
__LINE__
+
1
}
"
)
}
raise
InfiniteInterpolationError
if
caller
.
any?
{
|
b
|
b
.
index
(
RIGHT_HERE
)
}
attachment
.
url
(
style_name
,
false
)
attachment
.
url
(
style_name
,
false
)
end
end
...
...
test/attachment_test.rb
View file @
35cdaa54
...
@@ -606,7 +606,7 @@ class AttachmentTest < Test::Unit::TestCase
...
@@ -606,7 +606,7 @@ class AttachmentTest < Test::Unit::TestCase
[
:large
,
:medium
,
:small
].
each
do
|
style
|
[
:large
,
:medium
,
:small
].
each
do
|
style
|
io
=
@attachment
.
to_file
(
style
)
io
=
@attachment
.
to_file
(
style
)
# p "in commit to disk test, io is #{io.inspect} and @instance.id is #{@instance.id}"
# p "in commit to disk test, io is #{io.inspect} and @instance.id is #{@instance.id}"
assert
File
.
exists?
(
io
)
assert
File
.
exists?
(
io
.
path
)
assert
!
io
.
is_a?
(
::
Tempfile
)
assert
!
io
.
is_a?
(
::
Tempfile
)
io
.
close
io
.
close
end
end
...
...
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