Sha256: 856f0c3c2f6fe8c7545222adc737ad2ba6073b2efbe37d7f8d2ff8931542e387

Contents?: true

Size: 881 Bytes

Versions: 39

Compression:

Stored size: 881 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  class DatabaseConfigurations
    # ActiveRecord::Base.configurations will return either a HashConfig or
    # UrlConfig respectively. It will never return a DatabaseConfig object,
    # as this is the parent class for the types of database configuration objects.
    class DatabaseConfig # :nodoc:
      attr_reader :env_name, :spec_name

      def initialize(env_name, spec_name)
        @env_name = env_name
        @spec_name = spec_name
      end

      def replica?
        raise NotImplementedError
      end

      def migrations_paths
        raise NotImplementedError
      end

      def url_config?
        false
      end

      def to_legacy_hash
        { env_name => config }
      end

      def for_current_env?
        env_name == ActiveRecord::ConnectionHandling::DEFAULT_ENV.call
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 4 rubygems

Version Path
activerecord-6.0.6.1 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.6 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.5.1 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.5 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.4.8 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.4.7 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.4.6 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.4.5 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.4.4 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.4.3 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.4.2 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.4.1 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.4 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.3.7 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.3.6 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.3.5 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.3.4 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.3.3 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.3.2 lib/active_record/database_configurations/database_config.rb
activerecord-6.0.3.1 lib/active_record/database_configurations/database_config.rb