@@ -8,7 +8,7 @@ def mock_class(table_name, primary_key, columns)
88 options = {
99 :connection => mock ( "Conn" , :indexes => [ ] ) ,
1010 :table_name => table_name ,
11- :primary_key => primary_key && primary_key . to_s ,
11+ :primary_key => primary_key ,
1212 :column_names => columns . map { |col | col . name . to_s } ,
1313 :columns => columns
1414 }
@@ -72,7 +72,7 @@ def mock_column(name, type, options={})
7272 end
7373
7474 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 ] , [
7676 mock_column ( :a_id , :integer ) ,
7777 mock_column ( :b_id , :integer ) ,
7878 mock_column ( :name , :string , :limit => 50 )
@@ -83,8 +83,8 @@ def mock_column(name, type, options={})
8383#
8484# Table name: users
8585#
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
8888# name :string(50) not null
8989#
9090EOS
0 commit comments