test/helper.rb in paperclip-2.5.2 vs test/helper.rb in paperclip-2.6.0
- old
+ new
@@ -52,12 +52,16 @@
config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
ActiveRecord::Base.logger = ActiveSupport::BufferedLogger.new(File.dirname(__FILE__) + "/debug.log")
ActiveRecord::Base.establish_connection(config['test'])
Paperclip.options[:logger] = ActiveRecord::Base.logger
-Dir[File.join(File.dirname(__FILE__), 'support','*')].each do |f|
- require f
+def require_everything_in_directory(directory_name)
+ Dir[File.join(File.dirname(__FILE__), directory_name, '*')].each do |f|
+ require f
+ end
end
+
+require_everything_in_directory('support')
def reset_class class_name
ActiveRecord::Base.send(:include, Paperclip::Glue)
Object.send(:remove_const, class_name) rescue nil
klass = Object.const_set(class_name, Class.new(ActiveRecord::Base))