Ecotrust/wc-marine-debris — pull request #101 by perrygeo (2012-12-05 00:25:25+00:00)
Title: Download functionality

This branch contains three new features that we should look at merging:

1. **Download** csv datasets by passing a filter json. All data field plus special fields related to projects, organizations, events, sites, etc are included as columns

```
/events/download.csv?filter=[{%22type%22:%22event_type%22,%22value%22:%22Site%20Cleanup%22}]
```

2. **Unit conversion**. There is now a `UnitConversion` table to define multiplier factors when converting between units. The details of how and when to use it are abstracted into the `FieldValue` model as a `@converted_value` property ensuring that you can always call `field_value.converted_value` and get the right answer

3. **Caching** cleanup. Started the process of moving event-specific caches into the `Event` model and it's properties/methods. Makes views cleaner. The cache keys are normalized to `event__blahcache` which will eventually allow for wildcard invalidation.