spree/spree — pull request #4052 by cbrunsdon (2013-12-05 06:40:22+00:00)
Title: Remove object_params in favor of a callback system

object_params is one of the uglier areas of the code that is also
frequently in need of expanding upon (who remembers the promo
controller implementation?).

rather than continually expanding and class_evaling over top of
object_params, I have switched it to a callback based system that
extensions can subscribe to and do whatever action is required. While
all this changes is core is deprecates object_params for a single
callback, in our "live" site, this fixes the integration of 3 separate
extensions that deal with different payment types.

The ugliest part to this commit by far is the @updating_params instance
variable as a place to change the parameters, but I am very open to
suggestions or alternate sub/pub methods than ActiveSupport::Callbacks

From here, the next thing to do to clean it up farther is create a
CheckoutRequest object to start wrapping the functionality of the params
into cleaner portions.