@@ -98,7 +98,7 @@ class CockroachDBAdapter < PostgreSQLAdapter
98
98
st_polygon : { } ,
99
99
}
100
100
101
- # http://postgis.17.x6.nabble.com/Default-SRID-td5001115.html
101
+ # http://postgis.17.x6.nabble.com/Default-SRID-td5001115.html
102
102
DEFAULT_SRID = 0
103
103
104
104
include CockroachDB ::SchemaStatements
@@ -272,12 +272,9 @@ def initialize_type_map(m = type_map)
272
272
precision = extract_precision ( sql_type )
273
273
scale = extract_scale ( sql_type )
274
274
275
- # TODO(#178) this should never use DecimalWithoutScale since scale
276
- # is assumed to be 0 if it is not explicitly defined.
277
- #
278
275
# If fmod is -1, that means that precision is defined but not
279
276
# scale, or neither is defined.
280
- if fmod && fmod == -1
277
+ if fmod && fmod == -1 && ! precision . nil?
281
278
# Below comment is from ActiveRecord
282
279
# FIXME: Remove this class, and the second argument to
283
280
# lookups on PG
@@ -390,7 +387,7 @@ def extract_time_from_default(default)
390
387
# In general, it is hard to parse that, but it is easy to handle the common
391
388
# case of an empty array.
392
389
def extract_empty_array_from_default ( default )
393
- return unless supports_string_to_array_coercion?
390
+ return unless supports_string_to_array_coercion?
394
391
return unless default =~ /\A ARRAY\[ \] \z /
395
392
return "{}"
396
393
end
0 commit comments