Rapleaf/jack — pull request #44 by pwestling (2012-08-22 18:39:14+00:00)
Title: Added logic to respect rails updated_at

This patch adds logic to the jack models so that if a model has a field named updated_at, that field will be set to the current time every time the record is saved. This mirrors the way that Rails handles the updated_at field.

The changes include:

AbstractDatabseModel - atomically updated the updated_at field when the save method is called. Updated_at should change only if the record is successfully saved

ModelWithId and model.erb- The models have 2 new convenience methods hasField(String fieldName) and setField(String fieldName, Object value)

TestModelWithId - this does some basic testing of the new methods and the updated_at behavior

all other changes are too generated code - all the models with the 2 new methods, and Post with a new updated_at field in order to test the new behavior