Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Set logger to Rails.logger if Rails is available.

  • Loading branch information...
commit b0cb54ec9fd7eae82d6e66558bcd4a667521dae6 1 parent 67d5c0b
@justinko authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/paperclip/railtie.rb
View
4 lib/paperclip/railtie.rb
@@ -18,6 +18,8 @@ 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
@@ -25,8 +27,6 @@ def self.insert
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)
Please sign in to comment.
Something went wrong with that request. Please try again.