Commit b0cb54ec by Justin Ko

Set logger to Rails.logger if Rails is available.

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