Sha256: 2f479990980734cfcf4d270dab39b20a1adacaf4d0ad4fd0bf42bf3cdd3de50e

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 Bytes

Contents

# frozen_string_literal: true

namespace :db do
  namespace :gis do
    desc 'Setup PostGIS data in the database'
    task setup: [:load_config] do
      environments = [Rails.env]
      environments << 'test' if Rails.env.development?
      environments.each do |environment|
        ActiveRecord::Base.configurations
                          .configs_for(env_name: environment)
                          .reject { |env| env.configuration_hash['database'].blank? }
                          .each do |env|
          ActiveRecord::ConnectionAdapters::PostGIS::PostGISDatabaseTasks.new(env).setup_gis
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-postgis-adapter-7.0.1 lib/active_record/connection_adapters/postgis/databases.rake