Object
# File lib/dm-migrations/sql/table_creator.rb, line 69 69: def build_type(type_class) 70: schema = { :name => @name, :quote_column_name => quoted_name } 71: 72: [ :nullable, :nullable? ].each do |option| 73: next if (value = schema.delete(option)).nil? 74: warn "#{option.inspect} is deprecated, use :allow_nil instead" 75: schema[:allow_nil] = value unless schema.key?(:allow_nil) 76: end 77: 78: unless schema.key?(:allow_nil) 79: schema[:allow_nil] = !schema[:not_null] 80: end 81: 82: if type_class.kind_of?(String) 83: schema[:primitive] = type_class 84: else 85: type_map = @adapter.class.type_map 86: primitive = type_class.respond_to?(:primitive) ? type_class.primitive : type_class 87: options = (type_map[type_class] || type_map[primitive]) 88: 89: schema.update(type_class.options) if type_class.respond_to?(:options) 90: schema.update(options) 91: 92: schema.delete(:length) if type_class == DataMapper::Property::Text 93: end 94: 95: schema.update(@opts) 96: 97: schema[:length] = schema.delete(:size) if schema.key?(:size) 98: 99: @adapter.send(:with_connection) do |connection| 100: @adapter.property_schema_statement(connection, schema) 101: end 102: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.