Skip to content

Instantly share code, notes, and snippets.

@Lytol
Created December 11, 2008 21:07
Show Gist options
  • Save Lytol/34872 to your computer and use it in GitHub Desktop.
Save Lytol/34872 to your computer and use it in GitHub Desktop.
diff --git a/app/models/kid.rb b/app/models/kid.rb
index 0ad1f19..0b36aeb 100644
--- a/app/models/kid.rb
+++ b/app/models/kid.rb
@@ -1182,6 +1182,7 @@ class Kid < ActiveRecord::Base
def initialize_paid_status
# send paid event to client
favor(WebpageCategory.find_by_name("Homework Helper"))
+ logger.info("DEBUG: #{connection.inspect}")
connection.with_master do
send_command( { :token => 'paid', :obj => { :kid => to_kz_hash } } )
end
diff --git a/config/environment.rb b/config/environment.rb
index aa3e67f..185f32d 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -38,6 +38,12 @@ Rails::Initializer.run do |config|
config.action_controller.session_store = :active_record_store
config.action_controller.fragment_cache_store = :mem_cache_store, %w[localhost]
+
+ # Masochism for replication
+ #
+ config.after_initialize do
+ ActiveReload::ConnectionProxy.setup!
+ end unless RAILS_ENV == "test"
end
# We temporarily want to fallback to old sessions table to smooth the transition
diff --git a/config/environments/production.rb b/config/environments/production.rb
index e2449f9..c0c9094 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -21,11 +21,5 @@ config.action_controller.perform_caching = true
config.action_controller.session :session_domain => ".kidzui.com"
ActionController::Base.session_options[:session_domain] = '.kidzui.com'
-# Masochism for replication
-#
-config.after_initialize do
- ActiveReload::ConnectionProxy.setup!
-end
-
SUPPORT_EMAILS = ['[email protected]']
EDITORIAL_EMAILS = ['[email protected]', '[email protected]']
\ No newline at end of file
diff --git a/config/environments/qa.rb b/config/environments/qa.rb
index e65f234..bfd2103 100644
--- a/config/environments/qa.rb
+++ b/config/environments/qa.rb
@@ -25,9 +25,3 @@ ActionController::Base.session_options[:session_domain] = '.kidzui.com'
#
SUPPORT_EMAILS = ['[email protected]']
EDITORIAL_EMAILS = ['[email protected]']
-
-# Masochism for replication
-#
-config.after_initialize do
- ActiveReload::ConnectionProxy.setup!
-end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment