Commit bc6ed16b by Jon Yurek

Hide ActiveRecord-specific stuff in the Railtie

parent 65e0338f
......@@ -18,14 +18,18 @@ module Paperclip
class Railtie
def self.insert
ActiveRecord::Base.send(:include, Paperclip::Glue)
File.send(:include, Paperclip::Upfile)
Paperclip.options[:logger] = Rails.logger
Paperclip.options[:logger] = defined?(ActiveRecord) ? ActiveRecord::Base.logger : Rails.logger
if defined?(ActiveRecord)
ActiveRecord::Base.send(:include, Paperclip::Glue)
Paperclip.options[:logger] = ActiveRecord::Base.logger
ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:include, Paperclip::Schema)
ActiveRecord::ConnectionAdapters::Table.send(:include, Paperclip::Schema)
ActiveRecord::ConnectionAdapters::TableDefinition.send(:include, Paperclip::Schema)
end
File.send(:include, Paperclip::Upfile)
end
end
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