Skip to content
This repository
Browse code

columns method doesn't have name argument

  • Loading branch information...
commit 37ce852c51af9268910d1f69ab2a884962e97701 1 parent 55686ae
Rafael Mendonça França authored February 02, 2012
2  activerecord/lib/active_record/connection_adapters/schema_cache.rb
@@ -9,7 +9,7 @@ def initialize(conn)
9 9
         @tables     = {}
10 10
 
11 11
         @columns = Hash.new do |h, table_name|
12  
-          h[table_name] = conn.columns(table_name, "#{table_name} Columns")
  12
+          h[table_name] = conn.columns(table_name)
13 13
         end
14 14
 
15 15
         @columns_hash = Hash.new do |h, table_name|
9  activerecord/test/cases/migration/rename_column_test.rb
@@ -130,25 +130,24 @@ def test_change_column
130 130
         add_column 'test_models', 'age', :integer
131 131
         add_column 'test_models', 'approved', :boolean, :default => true
132 132
 
133  
-        label = "test_change_column Columns"
134  
-        old_columns = connection.columns(TestModel.table_name, label)
  133
+        old_columns = connection.columns(TestModel.table_name)
135 134
 
136 135
         assert old_columns.find { |c| c.name == 'age' && c.type == :integer }
137 136
 
138 137
         change_column "test_models", "age", :string
139 138
 
140  
-        new_columns = connection.columns(TestModel.table_name, label)
  139
+        new_columns = connection.columns(TestModel.table_name)
141 140
 
142 141
         refute new_columns.find { |c| c.name == 'age' and c.type == :integer }
143 142
         assert new_columns.find { |c| c.name == 'age' and c.type == :string }
144 143
 
145  
-        old_columns = connection.columns(TestModel.table_name, label)
  144
+        old_columns = connection.columns(TestModel.table_name)
146 145
         assert old_columns.find { |c|
147 146
           c.name == 'approved' && c.type == :boolean && c.default == true
148 147
         }
149 148
 
150 149
         change_column :test_models, :approved, :boolean, :default => false
151  
-        new_columns = connection.columns(TestModel.table_name, label)
  150
+        new_columns = connection.columns(TestModel.table_name)
152 151
 
153 152
         refute new_columns.find { |c| c.name == 'approved' and c.type == :boolean and c.default == true }
154 153
         assert new_columns.find { |c| c.name == 'approved' and c.type == :boolean and c.default == false }

0 notes on commit 37ce852

Please sign in to comment.
Something went wrong with that request. Please try again.