Skip to content

Commit

Permalink
Make ActionMailer::Previews methods class methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
seuros committed Aug 14, 2014
1 parent b649671 commit b937ea8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions actionmailer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 2 additions & 0 deletions actionmailer/lib/action_mailer/preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ module Previews #:nodoc:
# :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) }
Expand Down

0 comments on commit b937ea8

Please sign in to comment.