Permalink
Browse files

mostly decouple TableDefinition from the database connection

  • Loading branch information...
1 parent 1c9f7fa commit a80bcc395cd691f5a1ad11af8ad9cff1ab79163f @tenderlove tenderlove committed Mar 16, 2013
@@ -50,11 +50,11 @@ class TableDefinition
# that have been defined.
attr_accessor :columns, :indexes
- def initialize(base)
+ def initialize(types)
@columns = []
@columns_hash = {}
@indexes = {}
- @base = base
+ @native = types
end
# Appends a primary key definition to the table definition.
@@ -281,7 +281,7 @@ def primary_key_column_name
end
def native
- @base.native_database_types
+ @native
end
end
@@ -830,7 +830,7 @@ def rename_column_indexes(table_name, column_name, new_column_name)
private
def create_table_definition
- TableDefinition.new(self)
+ TableDefinition.new native_database_types
end
def update_table_definition(table_name, base)
@@ -901,7 +901,7 @@ def extract_table_ref_from_insert_sql(sql)
end
def create_table_definition
- TableDefinition.new(self)
+ TableDefinition.new native_database_types
end
def update_table_definition(table_name, base)

0 comments on commit a80bcc3

Please sign in to comment.