Sha256: 41c2fdbc96419d300552e2f6e05761132d5b91e354be3827967f6af700ccf882
Contents?: true
Size: 707 Bytes
Versions: 7
Compression:
Stored size: 707 Bytes
Contents
require "rails/generators" require_relative "../../test_data/generator_support" module TestData class DatabaseYamlGenerator < Rails::Generators::Base def call if Configurators::DatabaseYaml.new.verify.looks_good? TestData.log.info "'test_data' section already defined in config/database.yml" else app_name = Rails.application.railtie_name.chomp("_application") inject_into_file "config/database.yml", before: BEFORE_TEST_STANZA_REGEX do <<~YAML # Used in conjunction with the test_data gem test_data: <<: *default database: #{app_name}_test_data YAML end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems