Added docs for #indexes on adapters

This commit is contained in:
Sebastian Martinez
2011-04-22 20:13:24 -03:00
parent df70b9dfb2
commit 900470cf3c
3 changed files with 3 additions and 1 deletions

View File

@@ -611,6 +611,7 @@ module ActiveRecord
super(table_name, options)
end
# Returns an array of indexes for the given table.
def indexes(table_name, name = nil)#:nodoc:
indexes = []
current_index = nil

View File

@@ -690,7 +690,7 @@ module ActiveRecord
[schema, table]
end
# Returns the list of all indexes for a table.
# Returns an array of indexes for the given table.
def indexes(table_name, name = nil)
schemas = schema_search_path.split(/,/).map { |p| quote(p) }.join(',')
result = query(<<-SQL, name)

View File

@@ -263,6 +263,7 @@ module ActiveRecord
end
end
# Returns an array of indexes for the given table.
def indexes(table_name, name = nil) #:nodoc:
exec_query("PRAGMA index_list(#{quote_table_name(table_name)})", name).map do |row|
IndexDefinition.new(