Skip to content
Browse files

Set logger to Rails.logger if Rails is available.

  • Loading branch information...
1 parent 67d5c0b commit b0cb54ec9fd7eae82d6e66558bcd4a667521dae6 @justinko committed Feb 3, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/paperclip/railtie.rb
View
4 lib/paperclip/railtie.rb
@@ -18,15 +18,15 @@ class Railtie < Rails::Railtie
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
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)

0 comments on commit b0cb54e

Please sign in to comment.
Something went wrong with that request. Please try again.