Commit Graph

28 Commits

Author SHA1 Message Date
Andrew Haines 8599e21e2f Extract helper proxy 2012-10-14 23:01:15 +01:00
Andrew Haines c77ebf28a8 Extract Security class 2012-10-12 12:04:37 +01:00
Andrew Haines d06afda764 Rename ModelSupport to Decoratable 2012-10-09 10:11:57 +01:00
Andrew Haines 61e6027236 Rename DecoratedEnumerableProxy to CollectionDecorator 2012-10-09 10:07:14 +01:00
Andrew Haines 025742cb3b Rename Base to Decorator 2012-10-09 10:05:22 +01:00
Mike Moore 7117b2ee33 Update minitest integration
Since the integration is dependent on minitest-rails, use its test class.
Did MiniTest::Spec::Decorator ever exist in this project?
2012-09-27 13:46:27 -06:00
Ryan Fitzgerald 5b9288b3f6 Move view_context definition back into System.setup 2012-07-18 17:58:12 -07:00
Steve Klabnik 0b03d9c21e Monkeypatch ActionController::Base.
We need to be able to let draper get a copy of the view_context
no matter what happens. AC::Base doesn't really let us do that. So
we have to monkeypatch.

This was originally suggested in
https://github.com/jcasimir/draper/issues/124#issuecomment-6954291
by @rf-.

It appears to be the cleanest way to take care of this problem, and
shouldn't affect any other things, since we keep the exact same
semantics of view_context.

Theoretically:

Fixes #124
Fixes #109
2012-07-17 09:40:52 -04:00
Ryan Cook 78e782cfd7 add some clarity to `lib/draper.rb` regarding which requires are for supporting test libs 2012-05-18 00:04:25 -06:00
Ryan Cook 09b8445269 Minitest Integration
Closes #207
2012-05-17 20:36:49 -05:00
Steve Klabnik 3356b5ffe7 Fix initialization issue for ammeter 2012-05-09 18:58:19 -04:00
Steve Klabnik 51fef48258 Cleaning up gemspec and Gemfile 2012-05-09 18:30:33 -04:00
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