diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
| commit | e0a7e0fec760ba12c8067a37e10c96f1f05876e2 (patch) | |
| tree | d0cf745592a46aee4d4913911fd34c7c24515220 /vendor/plugins/globalize2/test/test_helper.rb | |
| parent | 6424e10be5a89f175a74c71c55660412a169b8b8 (diff) | |
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
Diffstat (limited to 'vendor/plugins/globalize2/test/test_helper.rb')
| -rw-r--r-- | vendor/plugins/globalize2/test/test_helper.rb | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/vendor/plugins/globalize2/test/test_helper.rb b/vendor/plugins/globalize2/test/test_helper.rb deleted file mode 100644 index 195907df..00000000 --- a/vendor/plugins/globalize2/test/test_helper.rb +++ /dev/null | |||
| @@ -1,76 +0,0 @@ | |||
| 1 | $LOAD_PATH << File.expand_path( File.dirname(__FILE__) + '/../lib' ) | ||
| 2 | |||
| 3 | require 'rubygems' | ||
| 4 | require 'test/unit' | ||
| 5 | require 'active_record' | ||
| 6 | require 'active_support' | ||
| 7 | require 'active_support/test_case' | ||
| 8 | require 'mocha' | ||
| 9 | require 'globalize' | ||
| 10 | require 'validation_reflection' | ||
| 11 | |||
| 12 | config = { :adapter => 'sqlite3', :database => ':memory:' } | ||
| 13 | ActiveRecord::Base.establish_connection(config) | ||
| 14 | |||
| 15 | class ActiveSupport::TestCase | ||
| 16 | def reset_db!(schema_path = nil) | ||
| 17 | schema_path ||= File.expand_path(File.dirname(__FILE__) + '/data/schema.rb') | ||
| 18 | ActiveRecord::Migration.verbose = false | ||
| 19 | ActiveRecord::Base.silence { load(schema_path) } | ||
| 20 | end | ||
| 21 | |||
| 22 | def assert_member(item, array) | ||
| 23 | assert_block "Item #{item} is not in array #{array}" do | ||
| 24 | array.member?(item) | ||
| 25 | end | ||
| 26 | end | ||
| 27 | |||
| 28 | def assert_belongs_to(model, associated) | ||
| 29 | assert model.reflect_on_all_associations(:belongs_to).detect { |association| | ||
| 30 | association.name.to_s == associated.to_s | ||
| 31 | } | ||
| 32 | end | ||
| 33 | |||
| 34 | def assert_has_many(model, associated) | ||
| 35 | assert model.reflect_on_all_associations(:has_many).detect { |association| | ||
| 36 | association.name.to_s == associated.to_s | ||
| 37 | } | ||
| 38 | end | ||
| 39 | end | ||
| 40 | |||
| 41 | module ActiveRecord | ||
| 42 | module ConnectionAdapters | ||
| 43 | class AbstractAdapter | ||
| 44 | def index_exists?(table_name, column_name) | ||
| 45 | indexes(table_name).any? { |index| index.name == index_name(table_name, column_name) } | ||
| 46 | end | ||
| 47 | end | ||
| 48 | end | ||
| 49 | end | ||
| 50 | |||
| 51 | # module ActiveRecord | ||
| 52 | # class BaseWithoutTable < Base | ||
| 53 | # self.abstract_class = true | ||
| 54 | # | ||
| 55 | # def create_or_update | ||
| 56 | # errors.empty? | ||
| 57 | # end | ||
| 58 | # | ||
| 59 | # class << self | ||
| 60 | # def columns() | ||
| 61 | # @columns ||= [] | ||
| 62 | # end | ||
| 63 | # | ||
| 64 | # def column(name, sql_type = nil, default = nil, null = true) | ||
| 65 | # columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null) | ||
| 66 | # reset_column_information | ||
| 67 | # end | ||
| 68 | # | ||
| 69 | # # Do not reset @columns | ||
| 70 | # def reset_column_information | ||
| 71 | # read_methods.each { |name| undef_method(name) } | ||
| 72 | # @column_names = @columns_hash = @content_columns = @dynamic_methods_hash = @read_methods = nil | ||
| 73 | # end | ||
| 74 | # end | ||
| 75 | # end | ||
| 76 | # end \ No newline at end of file | ||
