Browse files

Fixing loading of delayed_paperclip

  • Loading branch information...
1 parent a853f16 commit 61eb0d2d0eacee70350a22460032fed024c54a0a @Bertg Bertg committed Nov 14, 2011
Showing with 4 additions and 2 deletions.
  1. +1 −0 lib/delayed_paperclip.rb
  2. +3 −2 lib/delayed_paperclip/railtie.rb
View
1 lib/delayed_paperclip.rb
@@ -1,5 +1,6 @@
require 'delayed_paperclip/jobs'
require 'delayed_paperclip/attachment'
+require 'delayed_paperclip/railtie'
module DelayedPaperclip
View
5 lib/delayed_paperclip/railtie.rb
@@ -1,11 +1,12 @@
+require 'paperclip'
require 'delayed_paperclip'
module DelayedPaperclip
if defined? Rails::Railtie
require 'rails'
class Railtie < Rails::Railtie
initializer 'delayed_paperclip.insert_into_active_record' do
- ActiveSupport.on_load :paperclip do
+ ActiveSupport.on_load :active_record do
DelayedPaperclip::Railtie.insert
end
end
@@ -15,7 +16,7 @@ class Railtie < Rails::Railtie
class Railtie
def self.insert
ActiveRecord::Base.send(:include, DelayedPaperclip::Glue)
- Paperclip::Attachment.send :include, DelayedPaperclip::Attachment
+ Paperclip::Attachment.send(:include, DelayedPaperclip::Attachment)
end
end
end

0 comments on commit 61eb0d2

Please sign in to comment.