Sha256: e187071155b122ce1803c2bcc1625db9e14b9ae7cdb19200a20f34d4474de340
Contents?: true
Size: 749 Bytes
Versions: 18
Compression:
Stored size: 749 Bytes
Contents
module DataMigrate include ActiveSupport::Configurable class << self def configure yield config end def config @config ||= Config.new end end class Config attr_accessor :data_migrations_path, :data_template_path, :db_configuration, :spec_name DEFAULT_DATA_TEMPLATE_PATH = "data_migration.rb" def initialize @data_migrations_path = "db/data/" @data_template_path = DEFAULT_DATA_TEMPLATE_PATH @db_configuration = nil @spec_name = nil end def data_template_path=(value) @data_template_path = value.tap do |path| raise ArgumentError, "File not found: '#{path}'" unless path == DEFAULT_DATA_TEMPLATE_PATH || File.exist?(path) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems