Permalink
Browse files

[dm-migrations] Do not use quote_table_name or quote_column_name

* Updated to lookup schema details in adapter type_map using the primitive
  class if it is a custom type
  • Loading branch information...
1 parent f7ec76c commit 6c080467ad9c0b52ef2cb38cff37371639979676 @dkubb dkubb committed May 17, 2009
Showing with 4 additions and 3 deletions.
  1. +2 −1 lib/sql/table_creator.rb
  2. +2 −2 lib/sql/table_modifier.rb
View
3 lib/sql/table_creator.rb
@@ -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)
View
4 lib/sql/table_modifier.rb
@@ -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

0 comments on commit 6c08046

Please sign in to comment.