hashrocket / decent_exposure

A helper for creating declarative interfaces in controllers
MIT License
1.81k stars 107 forks source link

Stacked/multiple strategies #111

Closed hauleth closed 10 years ago

hauleth commented 10 years ago

It will be nice to have possibility to set list (array) of strategies that will be applied in order. It will make strategies more reusable, i.e.

strategy [
  DecentExposure::StrongParametersStrategy,
  MyStrategyToEnableDraperDecorators
]

Instead of creating own strategy that derivate from DecentExposure::StrongParametersStrategy.

icem commented 10 years ago

MyStrategyToEnableDraperDecorators can be derived from DecentExposure::StrongParametersStrategy and make use of #super.

hauleth commented 10 years ago

I know, and I have written that. But goal is to NOT doing that which allow to creating reusable strategies.

jgdavey commented 10 years ago

An interesting idea; however, with the way that decent_exposure is currently implemented, multiple strategies are impossible. It is designed to use one strategy class.

If you're interested in hacking on it, though, I'd be interested what you come up with.