From 4899ae188f728bfd77b6db950fd5a1e3180c7be8 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Mon, 30 Jan 2012 13:19:22 +0000 Subject: Create stubs for the various points where a user might want to customise Alaveteli via their theme, as per suggestions by @dcabo on [the mailing list](http://groups.google.com/group/alaveteli-dev/msg/f50eba23f75b5c75) --- lib/model_patches.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/model_patches.rb (limited to 'lib/model_patches.rb') diff --git a/lib/model_patches.rb b/lib/model_patches.rb new file mode 100644 index 0000000..694f54d --- /dev/null +++ b/lib/model_patches.rb @@ -0,0 +1,16 @@ +# Add a callback - to be executed before each request in development, +# and at startup in production - to patch existing app classes. +# Doing so in init/environment.rb wouldn't work in development, since +# 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 + OutgoingMessage.class_eval do + # Add intro paragraph to new request template + def default_letter + return nil if self.message_type == 'followup' + #"If you uncomment this line, this text will appear as default text in every message" + end + end +end -- cgit v1.2.3