test/helper.rb in paperclip-3.5.0 vs test/helper.rb in paperclip-3.5.1
- old
+ new
@@ -1,18 +1,17 @@
require 'rubygems'
require 'tempfile'
require 'pathname'
require 'test/unit'
-
-require 'shoulda'
-require 'mocha/setup'
-require 'bourne'
-
require 'active_record'
require 'active_record/version'
require 'active_support'
require 'active_support/core_ext'
+require 'shoulda'
+require 'mocha/setup'
+require 'bourne'
+require 'shoulda/context'
require 'mime/types'
require 'pathname'
require 'ostruct'
require 'pry'
@@ -46,12 +45,16 @@
require './shoulda_macros/paperclip'
FIXTURES_DIR = File.join(File.dirname(__FILE__), "fixtures")
config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
-ActiveRecord::Base.logger = ActiveSupport::BufferedLogger.new(File.dirname(__FILE__) + "/debug.log")
+ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
ActiveRecord::Base.establish_connection(config['test'])
Paperclip.options[:logger] = ActiveRecord::Base.logger
+
+def using_protected_attributes?
+ ActiveRecord::VERSION::MAJOR < 4
+end
def require_everything_in_directory(directory_name)
Dir[File.join(File.dirname(__FILE__), directory_name, '*')].each do |f|
require f
end