Sha256: d18e360c7e8ea3fd7ceb646e046fb5fc564b9819ad4dd67f8ffb99278cd2c6f6

Contents?: true

Size: 640 Bytes

Versions: 2

Compression:

Stored size: 640 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

2 entries across 2 versions & 1 rubygems

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