Skip to content

Commit 0908d72

Browse files
committed
Fix stupid mistake with the destroy handler, 2.1.2.1
1 parent 3f1927c commit 0908d72

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

init.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
require File.join(File.dirname(__FILE__), 'lib', 'dm-paperclip')
2-
File.send :include, Paperclip::Upfile
1+
require File.join(File.dirname(__FILE__), 'lib', 'dm-paperclip')

lib/dm-paperclip.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
require File.join(File.dirname(__FILE__), 'dm-paperclip', 'validations') unless defined?(DataMapper::Validate).nil?
3838

3939
module Paperclip
40-
VERSION = "2.1.2"
40+
VERSION = "2.1.2.1"
4141
class << self
4242
# Provides configurability to Paperclip. There are a number of options available, such as:
4343
# * whiny_thumbnails: Will raise an error if Paperclip cannot process thumbnails of
@@ -214,16 +214,12 @@ def save_attached_files
214214

215215
def destroy_attached_files
216216
each_attachment do |name, attachment|
217-
attachment.queue_existing_for_delete
218-
attachment.flush_deletes
217+
attachment.send(:queue_existing_for_delete)
218+
attachment.send(:flush_deletes)
219219
end
220220
end
221221
end
222222

223223
end
224224

225-
# Set it all up.
226-
if Object.const_defined?("ActiveRecord")
227-
ActiveRecord::Base.send(:include, Paperclip)
228-
File.send(:include, Paperclip::Upfile)
229-
end
225+
File.send(:include, Paperclip::Upfile)

0 commit comments

Comments
 (0)