pothoven-attachment_fu 3.2.12 → 3.2.13

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ * May 13, 2014 *
2
+ * Pull in changes from bacrossland to fix thumbnails for S3 storage
3
+
1
4
  * Apr 17, 2014 *
2
5
  * Pull in changes from jasonbuehler to fix Rails 4 errors
3
6
 
@@ -142,14 +142,15 @@ module Technoweenie # :nodoc:
142
142
 
143
143
  # The pseudo hierarchy containing the file relative to the container name
144
144
  # Example: <tt>:table_name/:id</tt>
145
- def base_path
146
- File.join(attachment_options[:path_prefix], attachment_path_id)
145
+ def base_path(thumbnail = nil)
146
+ file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix]
147
+ File.join(file_system_path, attachment_path_id)
147
148
  end
148
149
 
149
150
  # The full path to the file relative to the container name
150
151
  # Example: <tt>:table_name/:id/:filename</tt>
151
152
  def full_filename(thumbnail = nil)
152
- File.join(base_path, thumbnail_name_for(thumbnail))
153
+ File.join(base_path(thumbnail), thumbnail_name_for(thumbnail))
153
154
  end
154
155
 
155
156
  # All public objects are accessible via a GET request to the Cloud Files servers. You can generate a
@@ -252,14 +252,15 @@ module Technoweenie # :nodoc:
252
252
 
253
253
  # The pseudo hierarchy containing the file relative to the bucket name
254
254
  # Example: <tt>:table_name/:id</tt>
255
- def base_path
256
- File.join(attachment_options[:path_prefix], attachment_path_id)
255
+ def base_path(thumbnail = nil)
256
+ file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix]
257
+ File.join(file_system_path, attachment_path_id)
257
258
  end
258
259
 
259
260
  # The full path to the file relative to the bucket name
260
261
  # Example: <tt>:table_name/:id/:filename</tt>
261
262
  def full_filename(thumbnail = nil)
262
- File.join(base_path, thumbnail_name_for(thumbnail))
263
+ File.join(base_path(thumbnail), thumbnail_name_for(thumbnail))
263
264
  end
264
265
 
265
266
  # All public objects are accessible via a GET request to the S3 servers. You can generate a
@@ -433,6 +433,11 @@ module Technoweenie # :nodoc:
433
433
  # end
434
434
  #
435
435
  def with_image(&block)
436
+ # Write out the temporary data if it is not present
437
+ if temp_data.nil?
438
+ self.temp_data = current_data
439
+ end
440
+
436
441
  self.class.with_image(temp_path, &block)
437
442
  end
438
443
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pothoven-attachment_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.12
4
+ version: 3.2.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,10 +10,10 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-04-17 00:00:00.000000000 Z
13
+ date: 2014-05-13 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: This is a fork of Rick Olson's attachment_fu adding Ruby 1.9 and Rails
16
- 3.2 support as well as some other enhancements.
16
+ 3.2 and Rails 4 support as well as some other enhancements.
17
17
  email: steven@pothoven.net
18
18
  executables: []
19
19
  extensions: []
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  requirements: []
68
68
  rubyforge_project: nowarning
69
- rubygems_version: 1.8.24
69
+ rubygems_version: 1.8.29
70
70
  signing_key:
71
71
  specification_version: 2
72
72
  summary: attachment_fu as a gem