From e0a7e0fec760ba12c8067a37e10c96f1f05876e2 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Wed, 24 Jun 2026 04:13:16 +0200 Subject: Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade - Converted plugins to gems (Gemfile) - Updated config structure (application.rb, boot.rb, environment.rb) - Converted routes to Rails 3 DSL - Converted named_scope to scope throughout models - Converted find(:all, :conditions) to where() chains - Fixed has_many :order to use ordering scope - Updated session store and secret token configuration - Fixed exception_notification middleware configuration - Patched Ruby 2.4 / Rails 3.2 incompatibilities: - Integer/Float duration arithmetic (ActiveSupport) - Arel visit_Integer for PostgreSQL adapter - create_database String/Integer coercion - ActionController consider_all_requests_local - Migrated taggings schema for acts-as-taggable-on - Replaced dynamic_form gem with custom form_error_messages helper - Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for) - Fixed admin layout yield - Updated test suite for Rails 3 APIs --- vendor/plugins/paperclip/test/helper.rb | 82 --------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 vendor/plugins/paperclip/test/helper.rb (limited to 'vendor/plugins/paperclip/test/helper.rb') diff --git a/vendor/plugins/paperclip/test/helper.rb b/vendor/plugins/paperclip/test/helper.rb deleted file mode 100644 index 3e7e6a1c..00000000 --- a/vendor/plugins/paperclip/test/helper.rb +++ /dev/null @@ -1,82 +0,0 @@ -require 'rubygems' -require 'test/unit' -gem 'thoughtbot-shoulda', ">= 2.9.0" -require 'shoulda' -require 'mocha' -require 'tempfile' - -gem 'sqlite3-ruby' - -require 'active_record' -require 'active_support' -begin - require 'ruby-debug' -rescue LoadError - puts "ruby-debug not loaded" -end - -ROOT = File.join(File.dirname(__FILE__), '..') -RAILS_ROOT = ROOT - -$LOAD_PATH << File.join(ROOT, 'lib') -$LOAD_PATH << File.join(ROOT, 'lib', 'paperclip') - -require File.join(ROOT, 'lib', 'paperclip.rb') - -require 'shoulda_macros/paperclip' - -ENV['RAILS_ENV'] ||= 'test' - -FIXTURES_DIR = File.join(File.dirname(__FILE__), "fixtures") -config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml')) -ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log") -ActiveRecord::Base.establish_connection(config['test']) - -def reset_class class_name - ActiveRecord::Base.send(:include, Paperclip) - Object.send(:remove_const, class_name) rescue nil - klass = Object.const_set(class_name, Class.new(ActiveRecord::Base)) - klass.class_eval{ include Paperclip } - klass -end - -def reset_table table_name, &block - block ||= lambda{ true } - ActiveRecord::Base.connection.create_table :dummies, {:force => true}, &block -end - -def modify_table table_name, &block - ActiveRecord::Base.connection.change_table :dummies, &block -end - -def rebuild_model options = {} - ActiveRecord::Base.connection.create_table :dummies, :force => true do |table| - table.column :other, :string - table.column :avatar_file_name, :string - table.column :avatar_content_type, :string - table.column :avatar_file_size, :integer - table.column :avatar_updated_at, :datetime - end - rebuild_class options -end - -def rebuild_class options = {} - ActiveRecord::Base.send(:include, Paperclip) - Object.send(:remove_const, "Dummy") rescue nil - Object.const_set("Dummy", Class.new(ActiveRecord::Base)) - Dummy.class_eval do - include Paperclip - has_attached_file :avatar, options - end -end - -def temporary_rails_env(new_env) - old_env = defined?(RAILS_ENV) ? RAILS_ENV : nil - silence_warnings do - Object.const_set("RAILS_ENV", new_env) - end - yield - silence_warnings do - Object.const_set("RAILS_ENV", old_env) - end -end -- cgit v1.3