Skip to content

Commit

Permalink
Merge pull request #843 from hiptest/fix-327-concern-cause-app-to-con…
Browse files Browse the repository at this point in the history
…nect-to-db

Better implementation to test if connection to db is active
  • Loading branch information
booleanbetrayal authored Jul 6, 2017
2 parents 9fdf831 + 3e8657f commit c158898
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/models/devise_token_auth/concerns/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ def tokens_has_json_column_type?
end

def database_exists?
ActiveRecord::Base.connection
rescue ActiveRecord::NoDatabaseError
false
else
true
ActiveRecord::Base.connection_pool.with_connection { |con| con.active? } rescue false
end
end

Expand Down

0 comments on commit c158898

Please sign in to comment.