Permalink
Browse files

Revert "Allows configuration values to be Proc instances and solves r…

…ace condition setting value or #root"

This reverts commit b4bc772.
  • Loading branch information...
1 parent 9c676d8 commit 392c91dbed7d101db8392f8a1ebc8da1b74b703f @trevorturk trevorturk committed Sep 14, 2011
Showing with 3 additions and 15 deletions.
  1. +2 −3 lib/carrierwave/uploader/configuration.rb
  2. +1 −12 spec/uploader/paths_spec.rb
@@ -106,8 +106,7 @@ def self.#{name}=(value)
end
def #{name}
- value = self.class.#{name}
- value.instance_of?(Proc) ? value.call : value
+ self.class.#{name}
end
RUBY
end
@@ -150,7 +149,7 @@ def reset_config
config.ignore_processing_errors = true
config.validate_integrity = true
config.validate_processing = true
- config.root = lambda { CarrierWave.root }
+ config.root = CarrierWave.root
config.enable_processing = true
config.ensure_multipart_form = true
end
@@ -5,29 +5,18 @@
describe CarrierWave::Uploader do
before do
- @root = CarrierWave.root
- CarrierWave.root = nil
@uploader_class = Class.new(CarrierWave::Uploader::Base)
@uploader = @uploader_class.new
end
after do
FileUtils.rm_rf(public_path)
- CarrierWave.root = @root
end
describe '#root' do
-
it "should default to the config option" do
@uploader.root.should == public_path
end
-
- it "should default to the current value of CarrierWave.root" do
- @uploader.root.should be_nil
- CarrierWave.root = public_path
- @uploader.root.should == public_path
- end
-
end
-
+
end

0 comments on commit 392c91d

Please sign in to comment.