Permalink
Browse files

Moved AR include into a configure method to prevent non-inclusion whe…

…n using the git repo in the Gemfile
  • Loading branch information...
1 parent cdfefd6 commit 08f837f530336389ca7bf99e30bb893e3bb02edf @jyurek jyurek committed May 14, 2010
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/paperclip.rb
View
@@ -70,6 +70,12 @@ def options
}
end
+ def configure
+ ActiveRecord::Base.send(:include, Paperclip)
+ File.send(:include, Paperclip::Upfile)
+ yield(self) if block_given?
+ end
+
def path_for_command command #:nodoc:
if options[:image_magick_path]
warn("[DEPRECATION] :image_magick_path is deprecated and will be removed. Use :command_path instead")
@@ -358,9 +364,3 @@ def destroy_attached_files
end
end
-
-# Set it all up.
-if Object.const_defined?("ActiveRecord")
- ActiveRecord::Base.send(:include, Paperclip)
- File.send(:include, Paperclip::Upfile)
-end

0 comments on commit 08f837f

Please sign in to comment.