1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove deprecated nil-passing to SchemaCache methods.

This commit is contained in:
Yves Senn 2013-07-04 10:16:11 +02:00
parent 8c7c4f77e0
commit 8ee599ea86
2 changed files with 13 additions and 28 deletions

View file

@ -1,3 +1,8 @@
* Remove deprecated nil-passing to the following `SchemaCache` methods:
`primary_keys`, `tables`, `columns` and `columns_hash`.
*Yves Senn*
* Remove deprecated block filter from `ActiveRecord::Migrator#migrate`.
*Yves Senn*

View file

@ -16,13 +16,8 @@ module ActiveRecord
prepare_default_proc
end
def primary_keys(table_name = nil)
if table_name
@primary_keys[table_name]
else
ActiveSupport::Deprecation.warn('call primary_keys with a table name!')
@primary_keys.dup
end
def primary_keys(table_name)
@primary_keys[table_name]
end
# A cached lookup for table existence.
@ -41,34 +36,19 @@ module ActiveRecord
end
end
def tables(name = nil)
if name
@tables[name]
else
ActiveSupport::Deprecation.warn('call tables with a name!')
@tables.dup
end
def tables(name)
@tables[name]
end
# Get the columns for a table
def columns(table = nil)
if table
@columns[table]
else
ActiveSupport::Deprecation.warn('call columns with a table name!')
@columns.dup
end
def columns(table)
@columns[table]
end
# Get the columns for a table as a hash, key is the column name
# value is the column object.
def columns_hash(table = nil)
if table
@columns_hash[table]
else
ActiveSupport::Deprecation.warn('call columns_hash with a table name!')
@columns_hash.dup
end
def columns_hash(table)
@columns_hash[table]
end
# Clears out internal caches