Permalink
Browse files

We need to check here for the table name.

Abstract classes are having nil class name.
So nil.gsub will give a error here.
  • Loading branch information...
1 parent e7ee2a9 commit 891d0d7981f9aeeb34873d03d4b9d53d67423d31 @arunagw arunagw committed Sep 3, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -672,6 +672,7 @@ def tables(name = nil)
def table_exists?(name)
schema, table = extract_schema_and_table(name.to_s)
+ return false unless table # Abstract classes is having nil table name
binds = [[nil, table.gsub(/(^"|"$)/,'')]]
binds << [nil, schema] if schema

0 comments on commit 891d0d7

Please sign in to comment.