1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Make ActionMailer::Previews methods class methods.

This commit is contained in:
Abdelkader Boudih 2014-08-14 10:50:46 +00:00
parent b6496713e9
commit b937ea893e
2 changed files with 8 additions and 0 deletions

View file

@ -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.

View file

@ -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) }