Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Set logger to Rails.logger if Rails is available.

  • Loading branch information...
commit b0cb54ec9fd7eae82d6e66558bcd4a667521dae6 1 parent 67d5c0b
Justin Ko authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  lib/paperclip/railtie.rb
4  lib/paperclip/railtie.rb
@@ -18,6 +18,8 @@ class Railtie < Rails::Railtie
18 18
 
19 19
   class Railtie
20 20
     def self.insert
  21
+      Paperclip.options[:logger] = Rails.logger if defined?(Rails)
  22
+      
21 23
       if defined?(ActiveRecord)
22 24
         ActiveRecord::Base.send(:include, Paperclip::Glue)
23 25
         Paperclip.options[:logger] = ActiveRecord::Base.logger
@@ -25,8 +27,6 @@ def self.insert
25 27
         ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:include, Paperclip::Schema)
26 28
         ActiveRecord::ConnectionAdapters::Table.send(:include, Paperclip::Schema)
27 29
         ActiveRecord::ConnectionAdapters::TableDefinition.send(:include, Paperclip::Schema)
28  
-      else
29  
-        Paperclip.options[:logger] = Rails.logger
30 30
       end
31 31
 
32 32
       File.send(:include, Paperclip::Upfile)

0 notes on commit b0cb54e

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