From 8eb6b33a36197e2412327b6ec0dc99b93fb011d4 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 28 Jan 2015 14:29:17 -0800 Subject: do not require a database when running `rake assets:precompile` --- Gemfile | 4 +++- config/initializers/session_store.rb | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index e54ec6f..1444ff4 100644 --- a/Gemfile +++ b/Gemfile @@ -6,7 +6,9 @@ require File.expand_path('../lib/gemfile_tools.rb', __FILE__) gem "rails", "~> 3.2.21" gem "couchrest", "~> 1.1.3" gem "couchrest_model", "~> 2.0.0" -gem "couchrest_session_store", "~> 0.2.4" +unless ARGV.grep(/assets:precompile/) + gem "couchrest_session_store", "~> 0.2.4" +end ## AUTHENTICATION gem "ruby-srp", "~> 0.2.1" diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 8b63e5b..e8d8b64 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,11 +1,15 @@ # Be sure to restart your server when you modify this file. -LeapWeb::Application.config.session_store CouchRest::Session::Store, - expire_after: 1800 - -CouchRest::Session::Store.configure do |conf| - conf.environment = Rails.env - conf.connection_config_file = File.join(Rails.root, 'config', 'couchdb.yml') - conf.connection[:prefix] = - Rails.application.class.to_s.underscore.gsub(/\/.*/, '') -end +unless ARGV.grep(/assets:precompile/) + + LeapWeb::Application.config.session_store CouchRest::Session::Store, + expire_after: 1800 + + CouchRest::Session::Store.configure do |conf| + conf.environment = Rails.env + conf.connection_config_file = File.join(Rails.root, 'config', 'couchdb.yml') + conf.connection[:prefix] = + Rails.application.class.to_s.underscore.gsub(/\/.*/, '') + end + +end \ No newline at end of file -- cgit v1.2.3