Commit Graph

16 Commits

Author SHA1 Message Date
Steve Klabnik b516bda9c5 Merge branch 'active_model_support' of https://github.com/kurko/draper 2012-05-09 14:37:12 -04:00
Steve Klabnik 8b0b50e494 Move that railtie to where it belongs 2012-05-09 14:24:14 -04:00
Steve Klabnik 9155e58f74 Generators redux.
Lots of changes here:

* rake draper:install no longer needed
* don't generate an ApplicationGenerator by default
** If one exists, the generator respects it
* Fixes #53
2012-05-09 14:17:41 -04:00
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
Vasiliy Ermolovich 24ba88eb1c add new lines 😓 2012-04-25 23:12:30 +03:00
Steve Klabnik 1f442d71e4 Fixing regression regarding non-rails frameworks 2012-03-14 12:17:07 -06:00
Kevin Wang and Stephen Caudill 051dec8360 Convert Draper to using a Railtie for loading 2012-02-24 16:40:39 -05:00
Steve Klabnik ef368a3a88 Only include rspec if we really want it.
This closes #91.
2012-01-05 18:22:42 -05:00
Duncan Beevers a5a3c38770 Specs at spec/decorators prime the view context 2011-11-28 20:04:38 -06:00
Jeff Casimir b014e762e2 Implementing application-wide 'decorate' view helper 2011-10-28 22:20:28 -04:00
Jeff Casimir e644f777d2 Extraced DEP to its own file 2011-10-20 01:43:48 -04:00
Jeff Casimir 58989122eb Removed now unused AllHelpers code 2011-10-08 01:11:53 -04:00
Jeff Casimir 39fc5c9513 Rewrote technique for getting view_context/helper access 2011-10-08 01:06:19 -04:00
Paul Elliott 0711dc1413 Add decorator method to decorated model 2011-08-07 22:07:40 -04:00
Jeff Casimir 6c78b6cca6 Sleepy cowboy coding on the train 2011-07-13 01:00:10 -04:00
Jeff Casimir a3804b0662 Bring over generator structure from rails_decorators 2011-06-30 18:19:48 -04:00