Created
June 26, 2012 06:22
-
-
Save nathanscott/2993722 to your computer and use it in GitHub Desktop.
This file contains 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
# Get from form: | |
# params[:date] | |
# params[:categories] | |
def index | |
quote_requests_in_context | |
end | |
private | |
def quote_requests_in_context | |
base = QuoteRequest | |
if params[:date] | |
base = base.where(:date => params[:date]) | |
end | |
if params[:categories] | |
base = base.includes(:sub_categories).where(:sub_categories => SubCategory.find(params[:categories])) | |
end | |
base.all | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment