Sha256: 8c5ec9ee4f619e9191b9ebd13ead70675c1412cdc0baf420ab5101443eb44056
Contents?: true
Size: 369 Bytes
Versions: 3
Compression:
Stored size: 369 Bytes
Contents
module ShoppingCart class PlaceOrder < Rectify::Command def initialize(order) @order = order end def call ValidateStep.call(:confirm, @order) do on(:ok) { place_order } on(:invalid) { redirect_to root_path } end end private def place_order @order.completed @order.save end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
shopping-cart-0.1.2 | app/commands/shopping_cart/place_order.rb |
shopping-cart-0.1.1 | app/commands/shopping_cart/place_order.rb |
shopping-cart-0.1.0 | app/commands/shopping_cart/place_order.rb |