aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMark Longair <mhl@pobox.com>2013-04-09 15:57:13 +0100
committerMark Longair <mhl@pobox.com>2013-04-09 15:57:13 +0100
commita5537818e559c5a30c1bf07dd49a1f4cb06fa1ea (patch)
tree055c8099fced225bbe5e991af288b750187f80aa /lib
parente90c170f84ab4b91b25c673045bc0bbec0c5788a (diff)
Replace Dispatcher.to_prepare with Rails.configuration.to_prepare
Diffstat (limited to 'lib')
-rw-r--r--lib/controller_patches.rb3
-rw-r--r--lib/gettext_setup.rb3
-rw-r--r--lib/model_patches.rb3
-rw-r--r--lib/patch_mailer_paths.rb3
4 files changed, 4 insertions, 8 deletions
diff --git a/lib/controller_patches.rb b/lib/controller_patches.rb
index 11b5722..b512fa7 100644
--- a/lib/controller_patches.rb
+++ b/lib/controller_patches.rb
@@ -4,8 +4,7 @@
# classes are reloaded, but initialization is not run each time.
# See http://stackoverflow.com/questions/7072758/plugin-not-reloading-in-development-mode
#
-require 'dispatcher'
-Dispatcher.to_prepare do
+Rails.configuration.to_prepare do
# Example adding an instance variable to the frontpage controller
GeneralController.class_eval do
def mycontroller
diff --git a/lib/gettext_setup.rb b/lib/gettext_setup.rb
index 5b7a455..879bf57 100644
--- a/lib/gettext_setup.rb
+++ b/lib/gettext_setup.rb
@@ -1,7 +1,6 @@
# Add a callback - to be executed before each request in development,
# and at startup in production - to plug in theme locale strings.
-require 'dispatcher'
-Dispatcher.to_prepare do
+Rails.configuration.to_prepare do
repos = [
FastGettext::TranslationRepository.build('app', :path=>File.join(File.dirname(__FILE__), '..', 'locale-theme'), :type => :po),
FastGettext::TranslationRepository.build('app', :path=>'locale', :type => :po)
diff --git a/lib/model_patches.rb b/lib/model_patches.rb
index 694f54d..8abd4e8 100644
--- a/lib/model_patches.rb
+++ b/lib/model_patches.rb
@@ -4,8 +4,7 @@
# classes are reloaded, but initialization is not run each time.
# See http://stackoverflow.com/questions/7072758/plugin-not-reloading-in-development-mode
#
-require 'dispatcher'
-Dispatcher.to_prepare do
+Rails.configuration.to_prepare do
OutgoingMessage.class_eval do
# Add intro paragraph to new request template
def default_letter
diff --git a/lib/patch_mailer_paths.rb b/lib/patch_mailer_paths.rb
index d0a0b23..66348fb 100644
--- a/lib/patch_mailer_paths.rb
+++ b/lib/patch_mailer_paths.rb
@@ -2,8 +2,7 @@
# and at startup in production - to patch existing app classes.
# See http://stackoverflow.com/questions/7072758/plugin-not-reloading-in-development-mode
#
-require 'dispatcher'
-Dispatcher.to_prepare do
+Rails.configuration.to_prepare do
# Override mailer templates with theme ones. Note doing this in a before_filter,
# as we do with the controller paths, doesn't seem to have any effect when
# running in production