Commit 08f837f5 by Jon Yurek

Moved AR include into a configure method to prevent non-inclusion when using the…

Moved AR include into a configure method to prevent non-inclusion when using the git repo in the Gemfile
parent cdfefd69
...@@ -70,6 +70,12 @@ module Paperclip ...@@ -70,6 +70,12 @@ module Paperclip
} }
end 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: def path_for_command command #:nodoc:
if options[:image_magick_path] if options[:image_magick_path]
warn("[DEPRECATION] :image_magick_path is deprecated and will be removed. Use :command_path instead") warn("[DEPRECATION] :image_magick_path is deprecated and will be removed. Use :command_path instead")
...@@ -358,9 +364,3 @@ module Paperclip ...@@ -358,9 +364,3 @@ module Paperclip
end end
end end
# Set it all up.
if Object.const_defined?("ActiveRecord")
ActiveRecord::Base.send(:include, Paperclip)
File.send(:include, Paperclip::Upfile)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment