diff options
author | Aleksey Magusev <lexmag@gmail.com> | 2012-06-30 17:09:35 +0400 |
---|---|---|
committer | Aleksey Magusev <lexmag@gmail.com> | 2012-07-01 19:53:24 +0400 |
commit | 0fb13277aa1dff987e2cb644354fc81b94afb8a1 (patch) | |
tree | d34c1f418b12f2d6be9010c1f35e841793f5cec1 /activerecord/test/cases/migration/helper.rb | |
parent | d79ca9288e5c55563a554d05c779a41e701181cd (diff) | |
download | rails-0fb13277aa1dff987e2cb644354fc81b94afb8a1.tar.gz rails-0fb13277aa1dff987e2cb644354fc81b94afb8a1.tar.bz2 rails-0fb13277aa1dff987e2cb644354fc81b94afb8a1.zip |
Refactor migration test_helper
and create_join_table_test
Diffstat (limited to 'activerecord/test/cases/migration/helper.rb')
-rw-r--r-- | activerecord/test/cases/migration/helper.rb | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/activerecord/test/cases/migration/helper.rb b/activerecord/test/cases/migration/helper.rb index fe53510ba2..20f26786f0 100644 --- a/activerecord/test/cases/migration/helper.rb +++ b/activerecord/test/cases/migration/helper.rb @@ -14,8 +14,10 @@ module ActiveRecord module TestHelper attr_reader :connection, :table_name + CONNECTION_METHODS = %w[add_column remove_column rename_column add_index change_column rename_table] + class TestModel < ActiveRecord::Base - self.table_name = 'test_models' + self.table_name = :test_models end def setup @@ -36,29 +38,8 @@ module ActiveRecord end private - def add_column(*args) - connection.add_column(*args) - end - - def remove_column(*args) - connection.remove_column(*args) - end - - def rename_column(*args) - connection.rename_column(*args) - end - def add_index(*args) - connection.add_index(*args) - end - - def change_column(*args) - connection.change_column(*args) - end - - def rename_table(*args) - connection.rename_table(*args) - end + delegate(*CONNECTION_METHODS, to: :connection) end end end |