transform arrays from rails4 and type_cast_code too

fix passing type

require to_wkt_ to avoid method missing error
Update for AR3 and AR4 compatibility

-Use to_wkt_ ~>0.1.3 gem
-Fix SpatialColumn#type_caste_code for rails 3