diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-03-14 17:33:44 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-03-14 17:33:44 -0700 |
commit | abba61e2bbe320894ba8449ebdf778a1d2af545b (patch) | |
tree | 6a7942048e432a3c5a94102e9e146b076bd3882b /activerecord/lib | |
parent | 772c18e02811aa988a74bc4a9e999f153f1d8ad0 (diff) | |
download | rails-abba61e2bbe320894ba8449ebdf778a1d2af545b.tar.gz rails-abba61e2bbe320894ba8449ebdf778a1d2af545b.tar.bz2 rails-abba61e2bbe320894ba8449ebdf778a1d2af545b.zip |
hashes are ordered, so just use the columns_hash ivar
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index d3abc88fd5..18ddc3c322 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -63,15 +63,16 @@ module ActiveRecord 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 @@ module ActiveRecord def new_column_definition(base, name, type) definition = create_column_definition base, name, type - @columns << definition @columns_hash[name] = definition definition end |