Sha256: b76baef8649dd0dcd8757596675ba41e0710a1cac70f0607443c432b429512f0

Contents?: true

Size: 385 Bytes

Versions: 2

Compression:

Stored size: 385 Bytes

Contents

module RightnowOms
  class ApplicationController < ActionController::Base
    before_filter :set_null_to_nil

    protected
    def load_cart
      @cart = Cart.find_by_id(session[:cart_id]) || Cart.new
    end

    def set_null_to_nil(data = params)
      data.each do |k, v|
        set_null_to_nil(v) if v.is_a? Hash
        data[k] = nil if v == 'null'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rightnow_oms-0.0.4 app/controllers/rightnow_oms/application_controller.rb
rightnow_oms-0.0.3 app/controllers/rightnow_oms/application_controller.rb