1
0
Fork 0
mirror of https://github.com/drapergem/draper synced 2023-03-27 23:21:17 -04:00
Commit graph

3 commits

Author SHA1 Message Date
Alexandre de Oliveira
19496f0c4f Adds support for ActiveModel::Errors
The goal here is to improve ActiveModel support so that Draper can
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.

Other 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
2012-05-07 23:24:01 -03:00
Jeff Casimir
173c705422 Refactoring spec organization 2011-10-28 20:22:06 -04:00
Justin Ko
6a595ab20f Move spec/samples to spec/support/samples 2011-10-24 11:48:53 -06:00
Renamed from spec/samples/active_record.rb (Browse further)