Sha256: 44f2111b3162c8caf1344ce325c63627cb544f26ba16559d53f3f69b7b89534e

Contents?: true

Size: 340 Bytes

Versions: 7

Compression:

Stored size: 340 Bytes

Contents

module TbCheckout::ControllerHelpers
  extend ActiveSupport::Concern

  included do
    helper_method :tb_checkout_current_cart
  end

  def tb_checkout_current_cart
    return TbCheckout::Cart.find_or_create_by({
      :session_id => session.id,
      :spud_user_id => current_user.try(:id),
      :is_completed => false
    })
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tb_checkout-1.1.1 app/controllers/concerns/tb_checkout/controller_helpers.rb
tb_checkout-1.1.0 app/controllers/concerns/tb_checkout/controller_helpers.rb
tb_checkout-1.0.7 app/controllers/concerns/tb_checkout/controller_helpers.rb
tb_checkout-1.0.6 app/controllers/concerns/tb_checkout/controller_helpers.rb
tb_checkout-1.0.5 app/controllers/concerns/tb_checkout/controller_helpers.rb
tb_checkout-1.0.4 app/controllers/concerns/tb_checkout/controller_helpers.rb
tb_checkout-1.0.3 app/controllers/concerns/tb_checkout/controller_helpers.rb