Skip to content

Instantly share code, notes, and snippets.

if !params[:searchable].present?
params[:searchable] = {}
end
params[:searchable][:account_id] = @account.id
after_commit :reindex_es_async
def reindex_es_async
begin
Elasticsearch.reindex "Event", self.event_id
rescue
end
end
class ApplicationController < ActionController::Base
protect_from_forgery
protected
def create_cart
puts session.current_session_id
if session[:cart_id]
@current_cart = Cart.select("carts.*, items.*, cart_items.*").includes(:items).find( session[:cart_id] )