diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-12-21 13:22:52 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-12-21 13:22:52 -0800 |
commit | 68e91da765565f0c473463b0b47814592dea5de3 (patch) | |
tree | 7b97a7d3ac2788c3acc2da90245208e844621710 /activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | |
parent | 59ea907a30438a3aa458ef18f0ccb6ceadb8322d (diff) | |
parent | a81845f26864d076970e706863c766aead432672 (diff) | |
download | rails-68e91da765565f0c473463b0b47814592dea5de3.tar.gz rails-68e91da765565f0c473463b0b47814592dea5de3.tar.bz2 rails-68e91da765565f0c473463b0b47814592dea5de3.zip |
Merge pull request #8267 from marcandre/reversible_drop_table_etc
Reversible commands
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 18 |
1 files changed, 3 insertions, 15 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 73012834c9..b1ec33d06c 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -423,7 +423,7 @@ module ActiveRecord # t.remove(:qualification) # t.remove(:qualification, :experience) def remove(*column_names) - @base.remove_column(@table_name, *column_names) + @base.remove_columns(@table_name, *column_names) end # Removes the given index from the table. @@ -490,20 +490,8 @@ module ActiveRecord class_eval <<-EOV, __FILE__, __LINE__ + 1 def #{column_type}(*args) # def string(*args) options = args.extract_options! # options = args.extract_options! - column_names = args # column_names = args - type = :'#{column_type}' # type = :string - column_names.each do |name| # column_names.each do |name| - column = ColumnDefinition.new(@base, name.to_s, type) # column = ColumnDefinition.new(@base, name, type) - if options[:limit] # if options[:limit] - column.limit = options[:limit] # column.limit = options[:limit] - elsif native[type].is_a?(Hash) # elsif native[type].is_a?(Hash) - column.limit = native[type][:limit] # column.limit = native[type][:limit] - end # end - column.precision = options[:precision] # column.precision = options[:precision] - column.scale = options[:scale] # column.scale = options[:scale] - column.default = options[:default] # column.default = options[:default] - column.null = options[:null] # column.null = options[:null] - @base.add_column(@table_name, name, column.sql_type, options) # @base.add_column(@table_name, name, column.sql_type, options) + args.each do |name| # column_names.each do |name| + @base.add_column(@table_name, name, :#{column_type}, options) # @base.add_column(@table_name, name, :string, options) end # end end # end EOV |