Commit bc6ed16b by Jon Yurek

Hide ActiveRecord-specific stuff in the Railtie

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