Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
Only use this on production
Browse files Browse the repository at this point in the history
  • Loading branch information
nhocki committed Jun 15, 2011
1 parent 126824a commit 8b42c94
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/paperclip-s3/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class Railtie < Rails::Railtie

class Railtie
def self.insert
ActiveRecord::Base.send(:include, Paperclip::S3::Glue)
if (defined?(Rails.root) && Rails.root && Rails.root.production?) or
(defined?(RAILS_ROOT) && RAILS_ROOT && RAILS_ROOT =~ /production/)

ActiveRecord::Base.send(:include, Paperclip::S3::Glue)
end
end
end
Expand Down

0 comments on commit 8b42c94

Please sign in to comment.