Sha256: 0f3960602828e9de3cb0945e90e94b2aa26f59778a078caa3a60c91bfce60162

Contents?: true

Size: 387 Bytes

Versions: 9

Compression:

Stored size: 387 Bytes

Contents

module TestData
  class DetectsDatabaseEmptiness
    def initialize
      @config = TestData.config
    end

    def empty?
      result = ActiveRecord::Base.connection.execute <<~SQL
        select not exists (
          select from information_schema.tables
          where table_name = 'ar_internal_metadata'
        ) as empty
      SQL
      result.first["empty"]
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
test_data-0.3.2 lib/test_data/detects_database_emptiness.rb
test_data-0.3.1 lib/test_data/detects_database_emptiness.rb
test_data-0.3.0 lib/test_data/detects_database_emptiness.rb
test_data-0.2.2 lib/test_data/detects_database_emptiness.rb
test_data-0.2.1 lib/test_data/detects_database_emptiness.rb
test_data-0.2.0 lib/test_data/detects_database_emptiness.rb
test_data-0.1.0 lib/test_data/detects_database_emptiness.rb
test_data-0.0.2 lib/test_data/detects_database_emptiness.rb
test_data-0.0.1 lib/test_data/detects_database_emptiness.rb