Permalink
Browse files

Apparently people were mutating this array. :'(

This reverts commit abba61e.
  • Loading branch information...
1 parent abba61e commit ee460111370905b51f39c5c6566e647bb6d1d0bd @tenderlove tenderlove committed Mar 15, 2013
@@ -63,16 +63,15 @@ def add_column_options!(sql, options)
class TableDefinition
# An array of ColumnDefinition objects, representing the column changes
# that have been defined.
- attr_accessor :indexes
+ attr_accessor :columns, :indexes
def initialize(base)
+ @columns = []
@columns_hash = {}
@indexes = {}
@base = base
end
- def columns; @columns_hash.values; end
-
def xml(*args)
raise NotImplementedError unless %w{
sqlite mysql mysql2
@@ -302,6 +301,7 @@ def create_column_definition(base, name, type)
def new_column_definition(base, name, type)
definition = create_column_definition base, name, type
+ @columns << definition
@columns_hash[name] = definition
definition
end

1 comment on commit ee46011

Owner

jeremy commented on ee46011 Mar 15, 2013

Always Be Mutating™

Please sign in to comment.