Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Set logger to Rails.logger if Rails is available.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Ko committed Feb 3, 2012
1 parent 67d5c0b commit b0cb54e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/paperclip/railtie.rb
Expand Up @@ -18,15 +18,15 @@ class Railtie < Rails::Railtie


class Railtie class Railtie
def self.insert def self.insert
Paperclip.options[:logger] = Rails.logger if defined?(Rails)

if defined?(ActiveRecord) if defined?(ActiveRecord)
ActiveRecord::Base.send(:include, Paperclip::Glue) ActiveRecord::Base.send(:include, Paperclip::Glue)
Paperclip.options[:logger] = ActiveRecord::Base.logger Paperclip.options[:logger] = ActiveRecord::Base.logger


ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:include, Paperclip::Schema) ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:include, Paperclip::Schema)
ActiveRecord::ConnectionAdapters::Table.send(:include, Paperclip::Schema) ActiveRecord::ConnectionAdapters::Table.send(:include, Paperclip::Schema)
ActiveRecord::ConnectionAdapters::TableDefinition.send(:include, Paperclip::Schema) ActiveRecord::ConnectionAdapters::TableDefinition.send(:include, Paperclip::Schema)
else
Paperclip.options[:logger] = Rails.logger
end end


File.send(:include, Paperclip::Upfile) File.send(:include, Paperclip::Upfile)
Expand Down

0 comments on commit b0cb54e

Please sign in to comment.