rom-rb / rom

Data mapping and persistence toolkit for Ruby
https://rom-rb.org
MIT License
2.09k stars 161 forks source link

Allow multiple before/after hooks to be specified #379

Closed cflipse closed 7 years ago

cflipse commented 7 years ago

A relatively common pattern is to allow a hook to be specified multiple times. At present, calling a before or after multiple times will override the previous value.

I've attached a spec tweaked to demonstrate what I'd consider the less surprising behavior. I'm not conversant enough to argue with the Dry::Intitializer macros to make this actually pass, but I wanted to get this noted before we go live with the hooks.

solnic commented 7 years ago

I finalized this in master :)