jcasimir/draper — pull request #183 by kurko (2012-04-29 20:49:30+00:00)
Title: Adds support for ActiveModel::Errors

The goal here is to improve ActiveModel support so that Draper will be able to work
seamlessly with Rails' FormHelpers, proxying the model's #errors method.

I also added support for ActiveModel::Errors, adding a proxy to the
model's #errors method only if it's a descendant of
ActiveModel::Validations.

Also some refactoring was done. Draper now proxies #to_param and #id
methods only if the model is an ActiveModel descendant.

Others things I did include:

- created Draper::ActiveModelSupport::Proxies, which contains the
methods for proxying default methods(to_param, id, etc) depending on
the ancestors
- wrote specs for class with ActiveModel as ancestor
- wrote specs for class without ActiveModel as ancestor

Ideas on how to improve it?