configuration file getter changes. toggle selmer caching off if in "development environment"

This commit is contained in:
Gered 2013-07-29 22:55:07 -04:00
parent 01aeb70ed3
commit 3029eba653
3 changed files with 12 additions and 6 deletions

View file

@ -15,7 +15,8 @@
(reset! site-config (load-config))
@site-config))
(defn get-db-config
"returns just the database portion of the site configuration"
[]
(:database (get-config)))
(defn config-val [key]
(get (get-config) key))
(defn config-val-in [ks]
(get-in (get-config) ks))

View file

@ -5,6 +5,7 @@
blarg.routes.files
blarg.routes.rss
blarg.routes.accessrules
blarg.config
ring.middleware.head
compojure.core)
(:require [noir.util.middleware :as middleware]
@ -12,6 +13,7 @@
[compojure.route :as route]
[taoensso.timbre :as timbre]
[com.postspectacular.rotor :as rotor]
[selmer.parser :as parser]
[blarg.views.layout :as layout]
[blarg.models.db :as db]))
@ -42,6 +44,9 @@
{:path "blarg.log" :max-size 10000 :backlog 10})
(timbre/info "blarg started successfully")
(if (= "DEV" (config-val :env))
(parser/toggle-caching))
(timbre/info "touching database...")
(db/touch-databases))

View file

@ -1,10 +1,10 @@
(ns blarg.models.db
(:use [blarg.util])
(:require [blarg.config :as config]
(:require [blarg.config :refer [config-val]]
[com.ashafa.clutch :as couch]))
(defn db-url [db]
(let [c (config/get-db-config)
(let [c (config-val :database)
url (:url c)
user (:user c)
pass (:pass c)]