aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbdelkader Boudih <terminale@gmail.com>2014-08-14 10:50:46 +0000
committerAbdelkader Boudih <terminale@gmail.com>2014-08-14 10:55:12 +0000
commitb937ea893e5ad22f53a244ac17d085c1d40fdcc2 (patch)
tree17e5c33e370449af9801200d1c48086c649660ad
parentb6496713e9fb2e5e34716662087418931564646b (diff)
downloadrails-b937ea893e5ad22f53a244ac17d085c1d40fdcc2.tar.gz
rails-b937ea893e5ad22f53a244ac17d085c1d40fdcc2.tar.bz2
rails-b937ea893e5ad22f53a244ac17d085c1d40fdcc2.zip
Make ActionMailer::Previews methods class methods.
-rw-r--r--actionmailer/CHANGELOG.md6
-rw-r--r--actionmailer/lib/action_mailer/preview.rb2
2 files changed, 8 insertions, 0 deletions
diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md
index ab93745f60..451270bae3 100644
--- a/actionmailer/CHANGELOG.md
+++ b/actionmailer/CHANGELOG.md
@@ -1,3 +1,9 @@
+* Make ActionMailer::Previews methods class methods. Previously they were
+ instance methods and ActionMailer tries to render a message when they
+ are called.
+
+ *Cristian Bica*
+
* Deprecate `*_path` helpers in email views. When used they generate
non-working links and are not the intention of most developers. Instead
we recommend to use `*_url` helper.
diff --git a/actionmailer/lib/action_mailer/preview.rb b/actionmailer/lib/action_mailer/preview.rb
index 33de1dc049..44cf6665ba 100644
--- a/actionmailer/lib/action_mailer/preview.rb
+++ b/actionmailer/lib/action_mailer/preview.rb
@@ -22,7 +22,9 @@ module ActionMailer
# :nodoc:
mattr_accessor :preview_interceptors, instance_writer: false
self.preview_interceptors = []
+ end
+ module ClassMethods
# Register one or more Interceptors which will be called before mail is previewed.
def register_preview_interceptors(*interceptors)
interceptors.flatten.compact.each { |interceptor| register_preview_interceptor(interceptor) }