GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: DataMapper port of the Paperclip plugin by Thoughtbot
Homepage: http://invalidlogic.com/dm-paperclip/
Clone URL: git://github.com/krobertson/dm-paperclip.git
Fix stupid mistake with the destroy handler, 2.1.2.1
krobertson (author)
Thu May 15 22:11:20 -0700 2008
commit  0908d720ec9a89403acabad324ba469b1321d639
tree    8f30b42124b886ce7ac172d68165c95b9ec4cedf
parent  3f1927c5ab3d1f807c417c8e316911b856009fc9
...
1
2
 
3
...
 
 
1
2
0
@@ -1,2 +1 @@
0
-require File.join(File.dirname(__FILE__), 'lib', 'dm-paperclip')
0
-File.send :include, Paperclip::Upfile
0
+require File.join(File.dirname(__FILE__), 'lib', 'dm-paperclip')
0
\ No newline at end of file
...
37
38
39
40
 
41
42
43
...
214
215
216
217
218
 
 
219
220
221
222
223
224
225
226
227
228
229
 
...
37
38
39
 
40
41
42
43
...
214
215
216
 
 
217
218
219
220
221
222
223
224
 
 
 
 
 
225
0
@@ -37,7 +37,7 @@ require File.join(File.dirname(__FILE__), 'dm-paperclip', 'attachment')
0
 require File.join(File.dirname(__FILE__), 'dm-paperclip', 'validations') unless defined?(DataMapper::Validate).nil?
0
 
0
 module Paperclip
0
- VERSION = "2.1.2"
0
+ VERSION = "2.1.2.1"
0
   class << self
0
     # Provides configurability to Paperclip. There are a number of options available, such as:
0
     # * whiny_thumbnails: Will raise an error if Paperclip cannot process thumbnails of
0
@@ -214,16 +214,12 @@ module Paperclip
0
 
0
     def destroy_attached_files
0
       each_attachment do |name, attachment|
0
- attachment.queue_existing_for_delete
0
- attachment.flush_deletes
0
+ attachment.send(:queue_existing_for_delete)
0
+ attachment.send(:flush_deletes)
0
       end
0
     end
0
   end
0
 
0
 end
0
 
0
-# Set it all up.
0
-if Object.const_defined?("ActiveRecord")
0
- ActiveRecord::Base.send(:include, Paperclip)
0
- File.send(:include, Paperclip::Upfile)
0
-end
0
+File.send(:include, Paperclip::Upfile)

Comments

    No one has commented yet.