Sha256: 5f749964e2757eefb3a0c210ecd92e31e95da15059bd26de60ac30f943b30566

Contents?: true

Size: 384 Bytes

Versions: 3

Compression:

Stored size: 384 Bytes

Contents

module ShoppingCart
  class AddCheckoutDelivery < Rectify::Command
    def initialize(order, params)
      @order = order
      @params = params
    end

    def call
      update_delivery
    end

    private

    def update_delivery
      @order.update_attributes delivery_params
    end

    def delivery_params
      @params.require(:order).permit(:delivery_id)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shopping-cart-0.1.2 app/commands/shopping_cart/add_checkout_delivery.rb
shopping-cart-0.1.1 app/commands/shopping_cart/add_checkout_delivery.rb
shopping-cart-0.1.0 app/commands/shopping_cart/add_checkout_delivery.rb