Permalink
Browse files

fix up create_table override

  • Loading branch information...
1 parent 795896b commit eeab16db589376561c5d99b548b2031aa3c36d27 @matthuhiggins committed Jan 14, 2013
@@ -11,8 +11,11 @@ def self.included(base)
module AbstractAdapter
def create_table(table_name, *args, &block)
definition = nil
- super { |td| definition = td } # This is my trick to get the definition
- td.foreign_keys.each { |c,o| add_foreign_key table_name, c, o }
+ super do |td|
+ 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 }
end
def supports_foreign_keys?
@@ -1,5 +1,5 @@
require 'helper'
class Foreigner::ConnectionAdapters::SchemaStatementsTest < ActiveSupport::TestCase
-
+
end

0 comments on commit eeab16d

Please sign in to comment.