jeremyboles-graffic 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/graffic.rb +6 -2
- data/lib/graffic/view_helpers.rb +2 -1
- metadata +1 -1
data/lib/graffic.rb
CHANGED
@@ -200,8 +200,12 @@ class Graffic < ActiveRecord::Base
|
|
200
200
|
end
|
201
201
|
|
202
202
|
# Return the url for displaying the image
|
203
|
-
def url
|
204
|
-
|
203
|
+
def url(calculate = false)
|
204
|
+
if calculate
|
205
|
+
self.s3_key.public_link
|
206
|
+
else
|
207
|
+
"http://#{self.bucket}/#{uploaded_file_path}"
|
208
|
+
end
|
205
209
|
end
|
206
210
|
|
207
211
|
attr_accessor :use_queue
|
data/lib/graffic/view_helpers.rb
CHANGED
@@ -4,7 +4,8 @@ module Graffic::ViewHelpers
|
|
4
4
|
if version_or_opts.is_a?(Symbol)
|
5
5
|
graffic_tag(graffic.try(version_or_opts), opts)
|
6
6
|
else
|
7
|
-
|
7
|
+
|
8
|
+
image_tag(graffic.url, { :size => graffic.size }.merge(version_or_opts))
|
8
9
|
end
|
9
10
|
end
|
10
11
|
end
|