Skip to content

Instantly share code, notes, and snippets.

@laspluviosillas
Created February 4, 2015 15:06
Show Gist options
  • Save laspluviosillas/988017138a5f4aa14be4 to your computer and use it in GitHub Desktop.
Save laspluviosillas/988017138a5f4aa14be4 to your computer and use it in GitHub Desktop.
myeyeballs
params[:q][:created_at_gt] = params[:q][:created_at_gt].to_datetime if params[:q][:created_at_gt]
params[:q][:created_at_lt] = params[:q][:created_at_lt].to_datetime.end_of_day if params[:q][:created_at_gt]
@q = sessions.search(params[:q]) # search is perfomed by ransack
sessions = @q.result
params[:q][:created_at_gt] = params[:q][:created_at_gt].to_date if params[:q][:created_at_gt]
params[:q][:created_at_lt] = params[:q][:created_at_lt].to_date if params[:q][:created_at_gt]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment