Skip to content

Commit

Permalink
Merge pull request #3 from simco/fix_warning_with_uninitialized_variable
Browse files Browse the repository at this point in the history
initialize @start_query_counter in initializer of instance
  • Loading branch information
legacydevelopper1 authored Jan 6, 2017
2 parents 32d4ccb + 24fd96f commit 1cef549
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/active_record/query_counter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ class QueryCounter

COUNT_QUERY_TYPE = %w(SELECT UPDATE INSERT DELETE).freeze

def initialize
@start_query_counter = false
end

def start
@start_query_counter = true
end
Expand All @@ -13,7 +17,8 @@ def stop
end

def started?
@start_query_counter || false
# @start_query_counter || false
@start_query_counter
end

def restart
Expand Down

0 comments on commit 1cef549

Please sign in to comment.