Permalink
Browse files

Let table_exists? find tables in @@table_cache even if symbols are pa…

…ssed as their names
  • Loading branch information...
1 parent 4fdae4a commit f127338049f7317c238da71fc21b4f318c115a6c Ivan Ukhov committed with tenderlove Nov 17, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/arel/table.rb
View
@@ -8,7 +8,7 @@ class << self; attr_accessor :engine; end
attr_accessor :name, :engine, :aliases, :table_alias
def initialize name, engine = Table.engine
- @name = name
+ @name = name.to_s
@engine = engine
@columns = nil
@aliases = []
@@ -22,7 +22,7 @@ def initialize name, engine = Table.engine
# Sometime AR sends an :as parameter to table, to let the table know
# that it is an Alias. We may want to override new, and return a
# TableAlias node?
- @table_alias = engine[:as] unless engine[:as].to_s == name.to_s
+ @table_alias = engine[:as] unless engine[:as].to_s == name
end
end

0 comments on commit f127338

Please sign in to comment.