@@ -8,7 +8,7 @@ def mock_class(table_name, primary_key, columns)
8
8
options = {
9
9
:connection => mock ( "Conn" , :indexes => [ ] ) ,
10
10
:table_name => table_name ,
11
- :primary_key => primary_key && primary_key . to_s ,
11
+ :primary_key => primary_key ,
12
12
:column_names => columns . map { |col | col . name . to_s } ,
13
13
:columns => columns
14
14
}
@@ -72,7 +72,7 @@ def mock_column(name, type, options={})
72
72
end
73
73
74
74
it "should get schema info even if the primary key is array, if using composite_primary_keys" do
75
- klass = mock_class ( :users , nil , [
75
+ klass = mock_class ( :users , [ :a_id , :b_id ] , [
76
76
mock_column ( :a_id , :integer ) ,
77
77
mock_column ( :b_id , :integer ) ,
78
78
mock_column ( :name , :string , :limit => 50 )
@@ -83,8 +83,8 @@ def mock_column(name, type, options={})
83
83
#
84
84
# Table name: users
85
85
#
86
- # a_id :integer not null
87
- # b_id :integer not null
86
+ # a_id :integer not null, primary key
87
+ # b_id :integer not null, primary key
88
88
# name :string(50) not null
89
89
#
90
90
EOS
0 commit comments