model_attachment 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/model_attachment.rb +4 -2
  2. metadata +2 -2
@@ -14,7 +14,7 @@ require 'model_attachment/amazon'
14
14
 
15
15
  # The base module that gets included in ActiveRecord::Base.
16
16
  module ModelAttachment
17
- VERSION = "0.0.10"
17
+ VERSION = "0.0.11"
18
18
 
19
19
  class << self
20
20
 
@@ -129,7 +129,9 @@ module ModelAttachment
129
129
  server_name = options[:server_name] || "localhost"
130
130
  url_path = options[:path] || "/#{self.class.to_s.downcase.pluralize}/deliver/"
131
131
  type = options[:type]
132
+
132
133
  version = options[:version]
134
+ version_string = "?v=#{version}" if version
133
135
 
134
136
  server_name += ":" + port.to_s if port
135
137
  type_string = "?type=#{type}" if type
@@ -146,7 +148,7 @@ module ModelAttachment
146
148
  url = "#{proto}://#{server_name}#{url_path}#{basename}#{type_string}#{extension}"
147
149
  elsif bucket.nil?
148
150
  # otherwise use private url with deliver
149
- url = "#{proto}://#{server_name}#{url_path}#{id}#{type_string}?v=#{version}"
151
+ url = "#{proto}://#{server_name}#{url_path}#{id}#{type_string}#{version_string}"
150
152
  else
151
153
  # if bucket is set, then use aws url
152
154
  url = aws_url(type)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 10
9
- version: 0.0.10
8
+ - 11
9
+ version: 0.0.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - Steve Walker