Skip to content
Browse files

Remove deprecated nil-passing to `SchemaCache` methods.

  • Loading branch information...
1 parent 8c7c4f7 commit 8ee599ea86bd7fc565e15d2a1f69e50dd03ead82 @senny senny committed Jul 4, 2013
Showing with 13 additions and 28 deletions.
  1. +5 −0 activerecord/CHANGELOG.md
  2. +8 −28 activerecord/lib/active_record/connection_adapters/schema_cache.rb
View
5 activerecord/CHANGELOG.md
@@ -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
36 activerecord/lib/active_record/connection_adapters/schema_cache.rb
@@ -16,13 +16,8 @@ def initialize(conn)
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 @@ def add(table_name)
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

0 comments on commit 8ee599e

Please sign in to comment.
Something went wrong with that request. Please try again.