diff options
author | Sebastian Martinez <sebastian@wyeworks.com> | 2011-04-22 20:13:24 -0300 |
---|---|---|
committer | Sebastian Martinez <sebastian@wyeworks.com> | 2011-04-22 20:13:24 -0300 |
commit | 900470cf3cd346ad1b17cf6902f3f98e6dae7709 (patch) | |
tree | 40fe19d0b2ae518bf8c2bf58ed6128a3abfdbf8d /activerecord/lib | |
parent | df70b9dfb23aa05ed7ae7955ff0fb7eec68de9a3 (diff) | |
download | rails-900470cf3cd346ad1b17cf6902f3f98e6dae7709.tar.gz rails-900470cf3cd346ad1b17cf6902f3f98e6dae7709.tar.bz2 rails-900470cf3cd346ad1b17cf6902f3f98e6dae7709.zip |
Added docs for #indexes on adapters
Diffstat (limited to 'activerecord/lib')
3 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 1270a1292c..46842df024 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -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 diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 3f70d5d0f7..8d336de498 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -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) diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index a9dc756bbb..3eaa0f642f 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -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( |