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

25 commits

Author SHA1 Message Date
Chris Heald
719ddbf808 Add missing file 2012-05-10 17:54:31 -07:00
Chris Heald
eea4c866a6 If special ActiveModel methods like #id, #errors, and #to_param are defined directly on the decorator, do not redefine them as proxy methods. 2012-05-10 17:50:22 -07: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
Guilherme Cirne
f7eca344cc Makes decorates_association work transparently with Plain Old Ruby Objects. 2012-03-13 22:26:54 -03:00
Simon COURTOIS
108d4baaaf Adding a :polymorphic option to decorates_association 2012-03-08 14:21:26 +01: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
56ce55addb Zomg removing trailing whitespace. 2012-02-13 10:24:31 -05:00
Morton Jonuschat
a4927a51b5 Add forgotten sample file 2012-02-13 16:06:46 +01:00
Steve Tooke
7168e2ca74 Ensure NoMethodError propogates correctly.
When a delegated method calls a non-existant method the correct
NoMethodError should be called. If the NoMethodError is swallowed by
the decorator it can cause problems with BDD workflow.
2012-01-31 11:03:14 +00:00
Steve Tooke
51b03097f2 Remove trailing whitespace. 2012-01-31 10:11:55 +00:00
Jeff Casimir
81781988fa Adding support for automatic decoration of find_by_ methods 2012-01-16 20:27:48 -05:00
Michael Fairley
cb8820083f Add a require that got left out 2012-01-05 09:30:28 -08:00
Michael Fairley
22461fd7c1 Add with option to decorates_association to allow the decoration to be decorated by a specific association 2012-01-05 09:21:32 -08:00
Michael Fairley
7b6cd2634d Use published APIs for for decorates_association 2012-01-05 09:21:32 -08:00
Michael Fairley
1580baa287 Automatically decorate associations with decorates_association 2012-01-05 09:20:07 -08:00
Jeff Casimir
948160aab6 Resolving load-order issue on CI 2011-11-30 11:25:25 -05:00
Jeff Felchner
404f9d9044 Allow decorators to be inferred (Take 3) 2011-11-09 21:31:48 -06:00
ayaya
1c3d5667b8 add namespaced samples 2011-11-01 01:55:20 +08:00
Jeff Casimir
b014e762e2 Implementing application-wide 'decorate' view helper 2011-10-28 22:20:28 -04:00
Jeff Casimir
0893f1f813 Implementing #first and #last methods on decorators 2011-10-28 21:02:36 -04:00
Jeff Casimir
3670ef76ee Wrap the .all method to return a DecoratedEnumerableProxy 2011-10-28 20:38:43 -04:00
Jeff Casimir
173c705422 Refactoring spec organization 2011-10-28 20:22:06 -04:00
Justin Ko
dfd7cd456b Move require to file that needs it. 2011-10-24 11:49:37 -06:00
Justin Ko
6a595ab20f Move spec/samples to spec/support/samples 2011-10-24 11:48:53 -06:00