From 4bd2c48f7f1f75d71b3eaed73e3893a2b42b0fee Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 4 Apr 2016 14:59:27 +0100 Subject: Make code customization commented out examples. Rather than having them be live code. --- lib/model_patches.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'lib/model_patches.rb') diff --git a/lib/model_patches.rb b/lib/model_patches.rb index 8abd4e8..1564dc4 100644 --- a/lib/model_patches.rb +++ b/lib/model_patches.rb @@ -5,11 +5,13 @@ # See http://stackoverflow.com/questions/7072758/plugin-not-reloading-in-development-mode # Rails.configuration.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 + + # Example of adding a default text to each message + # 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 From 8ccab37ebc69e0e729b0b1748378006a811f4071 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 4 Apr 2016 15:05:20 +0100 Subject: Convert to two-space indentation. --- lib/model_patches.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/model_patches.rb') diff --git a/lib/model_patches.rb b/lib/model_patches.rb index 1564dc4..7f3b4de 100644 --- a/lib/model_patches.rb +++ b/lib/model_patches.rb @@ -6,12 +6,12 @@ # Rails.configuration.to_prepare do - # Example of adding a default text to each message - # 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 + # Example of adding a default text to each message + # 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 From a26a2d5bddb3cba85cbddfc7475e2706f20e34ac Mon Sep 17 00:00:00 2001 From: lizconlan Date: Fri, 2 Dec 2016 17:45:14 +0000 Subject: Update model patch example to include the default_letter param override --- lib/model_patches.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/model_patches.rb') diff --git a/lib/model_patches.rb b/lib/model_patches.rb index 7f3b4de..b0c906f 100644 --- a/lib/model_patches.rb +++ b/lib/model_patches.rb @@ -10,6 +10,10 @@ Rails.configuration.to_prepare do # OutgoingMessage.class_eval do # # Add intro paragraph to new request template # def default_letter + # # this line allows the default_letter text added by this + # # method to be replaced by the value supplied by the API + # # e.g. http://demo.alaveteli.org/new/tgq?default_letter=this+is+a+test + # return @default_letter if @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 -- cgit v1.2.3