Sha256: 23509f001908a3cac9afab3bef191cbfa4b0a672a97f9c32fbd1197903735706

Contents?: true

Size: 384 Bytes

Versions: 4

Compression:

Stored size: 384 Bytes

Contents

require 'yaml'

# Code for loading database configuration.

module ZenGarden
  module Database
    def database
      env_specific_yaml.with_indifferent_access
    end

    private
    def config_path
      "#{Rails.root}/config/database.yml"
    end

    def full_yaml
      YAML::load_file config_path
    end

    def env_specific_yaml
      full_yaml[Rails.env]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zen_garden-0.0.6 lib/zen_garden/database.rb
zen_garden-0.0.5 lib/zen_garden/database.rb
zen_garden-0.0.2 lib/zen_garden/database.rb
zen_garden-0.0.1 lib/zen_garden/database.rb