Skip to content

Commit

Permalink
Use ActiveRecord::Base for connection info
Browse files Browse the repository at this point in the history
Not ApplicationRecord, since it might not be defined, and
ActiveRecord::Base.connection is what is used everywhere else in this
class.
  • Loading branch information
NickLaMuro committed May 5, 2017
1 parent 68e7457 commit 1c28035
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/evm_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def self.local?
end

# Determines the average time to the database in milliseconds
def self.ping(connection = ApplicationRecord.connection)
def self.ping(connection = ActiveRecord::Base.connection)
query = "SELECT 1"
Benchmark.realtime { 10.times { connection.select_value(query) } } / 10 * 1000
end
Expand Down

0 comments on commit 1c28035

Please sign in to comment.