Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
[dm-migrations] Do not use quote_table_name or quote_column_name
Browse files Browse the repository at this point in the history
* Updated to lookup schema details in adapter type_map using the primitive
  class if it is a custom type
  • Loading branch information
dkubb committed May 17, 2009
1 parent f7ec76c commit 6c08046
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/sql/table_creator.rb
Expand Up @@ -64,7 +64,8 @@ def build_type(type_class)
if type_class.is_a?(String)
schema[:primitive] = type_class
else
schema = @adapter.class.type_map[type_class].merge(schema)
primitive = type_class.respond_to?(:primitive) ? type_class.primitive : type_class
schema = @adapter.class.type_map[primitive].merge(schema)
end
@adapter.send(:with_connection) do |connection|
@adapter.property_schema_statement(connection, schema)
Expand Down
4 changes: 2 additions & 2 deletions lib/sql/table_modifier.rb
Expand Up @@ -41,11 +41,11 @@ def change_column(name, type, opts = {})
end

def quote_column_name(name)
@adapter.send(:quote_column_name, name.to_s)
@adapter.send(:quote_name, name.to_s)
end

def quoted_table_name
@adapter.send(:quote_table_name, table_name)
@adapter.send(:quote_name, table_name)
end

end
Expand Down

0 comments on commit 6c08046

Please sign in to comment.