Update remove_index documentation

* Changes should better reflect present code behavior
* Related to issue: https://github.com/rails/rails/issues/1624
This commit is contained in:
Lucia Escanellas 2011-06-17 15:55:07 -03:00
parent 6ca18f9037
commit 144a388dec
3 changed files with 13 additions and 11 deletions

View File

@ -386,13 +386,13 @@ module ActiveRecord
# Removes the given index from the table.
#
# ===== Examples
# ====== Remove the suppliers_name_index in the suppliers table
# t.remove_index :name
# ====== Remove the index named accounts_branch_id_index in the accounts table
# ====== Remove the index_table_name_on_column in the table_name table
# t.remove_index :column
# ====== Remove the index named index_table_name_on_branch_id in the table_name table
# t.remove_index :column => :branch_id
# ====== Remove the index named accounts_branch_id_party_id_index in the accounts table
# ====== Remove the index named index_table_name_on_branch_id_and_party_id in the table_name table
# t.remove_index :column => [:branch_id, :party_id]
# ====== Remove the index named by_branch_party in the accounts table
# ====== Remove the index named by_branch_party in the table_name table
# t.remove_index :name => :by_branch_party
def remove_index(options = {})
@base.remove_index(@table_name, options)

View File

@ -346,11 +346,11 @@ module ActiveRecord
# Remove the given index from the table.
#
# Remove the suppliers_name_index in the suppliers table.
# remove_index :suppliers, :name
# Remove the index named accounts_branch_id_index in the accounts table.
# Remove the index_accounts_on_column in the accounts table.
# remove_index :accounts, :column
# Remove the index named index_accounts_on_branch_id in the accounts table.
# remove_index :accounts, :column => :branch_id
# Remove the index named accounts_branch_id_party_id_index in the accounts table.
# Remove the index named index_accounts_on_branch_id_and_party_id in the accounts table.
# remove_index :accounts, :column => [:branch_id, :party_id]
# Remove the index named by_branch_party in the accounts table.
# remove_index :accounts, :name => :by_branch_party

View File

@ -116,8 +116,10 @@ module ActiveRecord
# with the name of the column. Other options include
# <tt>:name</tt> and <tt>:unique</tt> (e.g.
# <tt>{ :name => "users_name_index", :unique => true }</tt>).
# * <tt>remove_index(table_name, index_name)</tt>: Removes the index specified
# by +index_name+.
# * <tt>remove_index(table_name, :column => column_name)</tt>: Removes the index
# specified by +column_name+.
# * <tt>remove_index(table_name, :name => index_name)</tt>: Removes the index
# specified by +index_name+.
#
# == Irreversible transformations
#