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 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
- self.s3_key.public_link
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
@@ -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
- image_tag(graffic.url, version_or_opts.merge(:size => graffic.size))
7
+
8
+ image_tag(graffic.url, { :size => graffic.size }.merge(version_or_opts))
8
9
  end
9
10
  end
10
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jeremyboles-graffic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Boles