mlouie/dchousing-apps — pull request #37 by jrunningen (2014-01-23 01:22:04+00:00)
Title: Add form field analysis

The app is now able to tell you a bit more about the fields it is trying to fill.

This branch adds the Dragoman class, which stores rules for producing form values from the Resident model attributes, based on the name of a field in a PDF.

Once you select a resident and a form, the form picker can tell you:

- Which values will go in which fields ("Provided fields")
- Which attributes the current resident lacks, but would make the PDF more complete if provided ("Still needed")
- Which PDF field names the app doesn't have any production rules for yet ("Unrecognized fields")

I have the page just printing the #inspect string for each of these collections. Obviously we'll want to narrow down this information to just what the user's interested in, and make it presentable.

Still to do:
- Create a global Dragoman object, rather than rebuilding one for every field, since the production rules don't change
- Isolate the Dragoman rules in their own file, so they are easier to manage
- Add more rules