Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

hashes are ordered, so just use the columns_hash ivar

  • Loading branch information...
commit abba61e2bbe320894ba8449ebdf778a1d2af545b 1 parent 772c18e
Aaron Patterson tenderlove authored
6 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
View
@@ -63,15 +63,16 @@ def add_column_options!(sql, options)
class TableDefinition
# An array of ColumnDefinition objects, representing the column changes
# that have been defined.
- attr_accessor :columns, :indexes
+ attr_accessor :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
@@ -301,7 +302,6 @@ 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
Please sign in to comment.
Something went wrong with that request. Please try again.