Skip to content
Browse files

Use Railtie to initialize CarrierWave

  • Loading branch information...
1 parent 128b219 commit a18c1c62c5e3904bb2be659f8027678819b31c40 @jnicklas jnicklas committed Feb 5, 2010
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/carrierwave.rb
View
11 lib/carrierwave.rb
@@ -80,8 +80,15 @@ module Test
elsif defined?(Rails)
- CarrierWave.root = File.join(Rails.root, 'public')
- ActiveSupport::Dependencies.load_paths << File.join(Rails.root, "app", "uploaders")
+ module CarrierWave
+ class Railtie < Rails::Railtie
+ railtie_name :carrierwave
+
+ initializer "carrierwave.setup_paths" do
+ CarrierWave.root = Rails.root.join(Rails.public_path)
+ end
+ end
+ end
elsif defined?(Sinatra)

0 comments on commit a18c1c6

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