Skip to content
This repository has been archived by the owner on Dec 5, 2018. It is now read-only.

Commit

Permalink
handle modified queries not incrementing
Browse files Browse the repository at this point in the history
  • Loading branch information
Zach Morek committed Nov 13, 2013
1 parent a500631 commit fd2653f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/run_queries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ def new
def create
@run_query = RunQuery.new(run_query_params)
saved_query = SavedQuery.where(:sql => run_query_params[:sql]).first
SavedQuery.increment_counter(:query_count, saved_query.id)
if saved_query
SavedQuery.increment_counter(:query_count, saved_query.id)
end

if @run_query.valid?
@query_runner = QueryRunner.new(@run_query.sql)
Expand Down

0 comments on commit fd2653f

Please sign in to comment.