Commit aaab884f by Cuong Tran

Merge pull request #137 from AMekss/fix_composite_primary_keys_test

Fix composite primary keys test
parents f1af392d 8f958f43
...@@ -8,7 +8,7 @@ describe AnnotateModels do ...@@ -8,7 +8,7 @@ describe AnnotateModels do
options = { options = {
:connection => mock("Conn", :indexes => []), :connection => mock("Conn", :indexes => []),
:table_name => table_name, :table_name => table_name,
:primary_key => primary_key && primary_key.to_s, :primary_key => primary_key,
:column_names => columns.map { |col| col.name.to_s }, :column_names => columns.map { |col| col.name.to_s },
:columns => columns :columns => columns
} }
...@@ -72,7 +72,7 @@ EOS ...@@ -72,7 +72,7 @@ EOS
end end
it "should get schema info even if the primary key is array, if using composite_primary_keys" do it "should get schema info even if the primary key is array, if using composite_primary_keys" do
klass = mock_class(:users, nil, [ klass = mock_class(:users, [:a_id, :b_id], [
mock_column(:a_id, :integer), mock_column(:a_id, :integer),
mock_column(:b_id, :integer), mock_column(:b_id, :integer),
mock_column(:name, :string, :limit => 50) mock_column(:name, :string, :limit => 50)
...@@ -83,8 +83,8 @@ EOS ...@@ -83,8 +83,8 @@ EOS
# #
# Table name: users # Table name: users
# #
# a_id :integer not null # a_id :integer not null, primary key
# b_id :integer not null # b_id :integer not null, primary key
# name :string(50) not null # name :string(50) not null
# #
EOS EOS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment