Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 08f837f530336389ca7bf99e30bb893e3bb02edf 1 parent cdfefd6
@jyurek jyurek authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/paperclip.rb
View
12 lib/paperclip.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.