Created
January 13, 2012 20:10
-
-
Save ncdc/1608450 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
class RunsController < ApplicationController | |
# GET /runs | |
# GET /runs.json | |
def index | |
# start with all runs | |
@runs = Run.where('') | |
@since = params[:since] | |
@runs = @runs.since(@since.to_i.days.ago) if params[:since] | |
@passed = params[:passed] || "" | |
@runs = @runs.where(:passed => (params[:passed] == 'true')) unless params[:passed].blank? | |
@feature_file = params[:feature_file] || "" | |
@runs = @runs.includes(:feature_file).where(FeatureFile.arel_table[:name].matches("%#{params[:feature_file]}%")) if params[:feature_file] | |
@count = @runs.count | |
@offset = params[:offset] || 0 | |
@runs = @runs.limit(100).offset(@offset).reverse_order | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render :json => @runs } | |
format.js | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment