mapbox/tilemill — Issue #1119: datasource field named 'length' breaks inspector
Author: springmeyer
Created: 2012-01-11 16:54:27+00:00
State: open

I have and osm2pgsql import with a field named length and I think it is the reason for a breakage here:

https://github.com/mapbox/tilemill/blob/master/models/Datasource.server.bones#L62-68

This works around:

```diff
datasource.fields[f].max = type === 'String'
- ? _(values).max(function(v) { return v.length })
+ ? _(values).max(function(v) { return v !== undefined ? v.length : 0 })
: _(values).max();
datasource.fields[f].min = type === 'String'
- ? _(values).min(function(v) { return v.length })
+ ? _(values).min(function(v) { return v !== undefined ? v.length : 0 })
: _(values).min();
```