This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after_commit :reindex_es_async | |
def reindex_es_async | |
begin | |
Elasticsearch.reindex "Event", self.event_id | |
rescue | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if !params[:searchable].present? | |
params[:searchable] = {} | |
end | |
params[:searchable][:account_id] = @account.id |