Toby Ovod-Everett
fd359976d4
Replaced Draper.validate_options with assert_valid_keys. Much better!
2012-12-13 06:10:19 +00:00
Toby Ovod-Everett
b2f63882ec
Restore context. Collections inherit context by default, but associations
...
can specify either a static context or a lambda. Validation for options
in a number of methods.
2012-12-13 06:10:19 +00:00
Andrew Haines
aeac106de5
Remove context
...
`context` and `options` were performing essentially the same
function.
We can just use `decorate(source, role: :admin)`
instead of `decorate(source, context: {role: :admin})`.
2012-11-08 00:05:41 +00:00
Andrew Haines
30104b0fc0
Move :infer option to CollectionDecorator
2012-11-07 23:19:05 +00:00
Andrew Haines
f59ad34fc2
More spec clean-up
2012-11-01 02:06:03 +00:00
Andrew Haines
dc53646376
Add UninferrableDecoratorError
2012-11-01 02:06:03 +00:00
Andrew Haines
4ccf21d900
Delegate all Array methods to decorated collection
2012-11-01 02:06:03 +00:00
Andrew Haines
ecd5b06274
Simplify CollectionDecorator#find
2012-11-01 02:05:58 +00:00
Andrew Haines
f21b92cda4
Consolidate CollectionDecorator.new and .decorate
2012-10-31 23:49:12 +00:00
Andrew Haines
785ed94a89
Minor changes for consistency
2012-10-31 23:19:50 +00:00
Andrew Haines
08d1f8533f
Refactor decorator inferring
2012-10-31 23:19:33 +00:00
Andrew Haines
d017518b33
Use alias_method throughout for consistency
2012-10-31 22:27:40 +00:00
Magnus Bergmark
e0dda6adae
Fix warnings when generating documentation
2012-10-25 07:45:02 +02:00
Jacques Fuentes
23c78ba453
Use ViewHelpers in collection decorator
2012-10-16 10:45:09 -04:00
Chris Gunther
88c7256f25
CollectionDecorator#find with block proxies to decorated_collection
...
#find with a block should return an instance of the decorated model,
not the undecorated model
2012-10-12 15:25:29 -04:00
Andrew Haines
61e6027236
Rename DecoratedEnumerableProxy to CollectionDecorator
2012-10-09 10:07:14 +01:00