Skip to content

Commit

Permalink
adjust create_table
Browse files Browse the repository at this point in the history
(I would suggest adding tests, but I am not currently sure where to
put them.)
  • Loading branch information
David James committed Feb 7, 2013
1 parent 8f499de commit fcfc684
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -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?
Expand Down

0 comments on commit fcfc684

Please sign in to comment.