Skip to content

Commit

Permalink
Change the create_versioned_table class method to ask the connection …
Browse files Browse the repository at this point in the history
…if table_exists?. Fixes a bug that allows adapters that allow user owned prefixes for table names.

Signed-off-by: rick <technoweenie@gmail.com>
  • Loading branch information
metaskills authored and technoweenie committed Feb 9, 2009
1 parent 779b063 commit 706d6a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/acts_as_versioned.rb
Expand Up @@ -409,7 +409,7 @@ def create_versioned_table(create_table_options = {})
self.reset_column_information
end

return if connection.tables.include?(versioned_table_name.to_s)
return if connection.table_exists?(versioned_table_name)

self.connection.create_table(versioned_table_name, create_table_options) do |t|
t.column versioned_foreign_key, :integer
Expand Down

0 comments on commit 706d6a3

Please sign in to comment.