Skip to content

Commit

Permalink
Using a Glue class to include DelayedPaperclip into ActiveRecord.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertg committed Nov 12, 2011
1 parent a1e412f commit 562e371
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/delayed_paperclip.rb
Expand Up @@ -33,8 +33,10 @@ def process_job(instance_klass, instance_id, attachment_name)

end

def self.included(base)
base.extend(ClassMethods)
module Glue
def self.included base #:nodoc:
base.extend(ClassMethods)
end
end

module ClassMethods
Expand Down
2 changes: 1 addition & 1 deletion lib/delayed_paperclip/railtie.rb
Expand Up @@ -14,7 +14,7 @@ class Railtie < Rails::Railtie

class Railtie
def self.insert
ActiveRecord::Base.send(:include, DelayedPaperclip)
ActiveRecord::Base.send(:include, DelayedPaperclip::Glue)
Paperclip::Attachment.send :include, DelayedPaperclip::Attachment
end
end
Expand Down

0 comments on commit 562e371

Please sign in to comment.