model_attachment 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/model_attachment.rb +4 -2
- metadata +2 -2
data/lib/model_attachment.rb
CHANGED
@@ -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.
|
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}
|
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)
|