Sha256: a6f0ec7fa982719537d2ff21b5328f59e519e516d79fdf40b1f10c398f9ec09f

Contents?: true

Size: 492 Bytes

Versions: 2

Compression:

Stored size: 492 Bytes

Contents

require "multiverse/generators"
require "multiverse/railtie"
require "multiverse/version"

module Multiverse
  class << self
    attr_writer :db

    def db
      @db ||= ENV["DB"].presence
    end

    def db_dir
      db_dir = "#{Rails.application.config.paths["db"].first}/#{db}"
      abort "Unknown DB: #{db}" unless Dir.exist?(db_dir)
      db_dir
    end

    def parent_class_name
      "#{db.camelize}Record"
    end

    def migrate_path
      "#{db_dir}/migrate"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
multiverse-0.2.2 lib/multiverse.rb
multiverse-0.2.1 lib/multiverse.rb