lib/spiderfw/model/storage/db/adapters/mysql.rb in spiderfw-0.5.7 vs lib/spiderfw/model/storage/db/adapters/mysql.rb in spiderfw-0.5.9
- old
+ new
@@ -10,11 +10,12 @@
end
@capabilities = {
:autoincrement => true,
:sequences => false,
- :transactions => true
+ :transactions => true,
+ :foreign_keys => true
}
@reserved_keywords = superclass.reserved_keywords
@safe_conversions = {
'CHAR' => ['VARCHAR', 'CLOB'],
'VARCHAR' => ['CLOB'],
@@ -226,9 +227,11 @@
def prepare_value(type, value)
value = super(type, value)
return value unless value
case type.name
+ when 'String'
+ return value.to_s
when 'Date', 'DateTime'
return value.strftime("%Y-%m-%dT%H:%M:%S")
when 'Fixnum'
return value.to_i
end