Permalink
Browse files

adjust create_table

(I would suggest adding tests, but I am not currently sure where to
put them.)
  • Loading branch information...
1 parent 8f499de commit fcfc684d57e9f92efa9c40c2695d5a7f90b06293 @xpe xpe committed Feb 7, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/foreigner/connection_adapters/abstract/schema_statements.rb
@@ -15,7 +15,11 @@ def create_table(table_name, *args, &block)
definition = td # This is my trick to get the definition
block.call(td)
end
- definition.foreign_keys.each { |c,o| add_foreign_key table_name, c, o }
+ definition.foreign_keys.each do |to_table, options_list|
+ options_list.each do |options|
+ add_foreign_key(table_name, to_table, options)
+ end
+ end
end
def supports_foreign_keys?

0 comments on commit fcfc684

Please sign in to comment.