Skip to content

Commit 35cdaa5

Browse files
author
Jon Yurek
committed
Tests pass in Rubinius 1.1.0
1 parent fa7ee7c commit 35cdaa5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/paperclip/interpolations.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ def filename attachment, style_name
4141
# Returns the interpolated URL. Will raise an error if the url itself
4242
# contains ":url" to prevent infinite recursion. This interpolation
4343
# is used in the default :path to ease default specifications.
44+
RIGHT_HERE = "#{__FILE__.gsub(%r{^\./}, "")}:#{__LINE__ + 3}"
4445
def url attachment, style_name
45-
raise InfiniteInterpolationError if caller.any?{|b| b.index("#{__FILE__}:#{__LINE__ + 1}") }
46+
raise InfiniteInterpolationError if caller.any?{|b| b.index(RIGHT_HERE) }
4647
attachment.url(style_name, false)
4748
end
4849

test/attachment_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ def do_after_all; end
606606
[:large, :medium, :small].each do |style|
607607
io = @attachment.to_file(style)
608608
# p "in commit to disk test, io is #{io.inspect} and @instance.id is #{@instance.id}"
609-
assert File.exists?(io)
609+
assert File.exists?(io.path)
610610
assert ! io.is_a?(::Tempfile)
611611
io.close
612612
end

0 commit comments

Comments
 (0)