aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/CHANGELOG2
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb8
2 files changed, 3 insertions, 7 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index cd0737836f..c8c4cf8845 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Support the :column option for remove_index with the PostgreSQL adapter. #3661 [shugo@ruby-lang.org]
+
* Add documentation for add_index and remove_index. #3600 [Manfred Stienstra <m.stienstra@fngtps.com>]
* If the OCI library is not available, raise an exception indicating as much. #3593 [schoenm@earthlink.net]
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index fbb978e034..066a71fab6 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -325,13 +325,7 @@ module ActiveRecord
end
def remove_index(table_name, options) #:nodoc:
- if Hash === options
- index_name = options[:name]
- else
- index_name = "#{table_name}_#{options}_index"
- end
-
- execute "DROP INDEX #{index_name}"
+ execute "DROP INDEX #{index_name(table_name, options)}"
end