Skip to content

Commit

Permalink
Make ActionMailer::Previews methods class methods.
Browse files Browse the repository at this point in the history
Conflicts:
	actionmailer/CHANGELOG.md
  • Loading branch information
seuros authored and chancancode committed Aug 19, 2014
1 parent e1f358d commit 06b185c
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
@@ -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*

* Raise an exception when attachments are added after `mail` was called.
This is a safeguard to prevent invalid emails.

Expand Down
2 changes: 2 additions & 0 deletions actionmailer/lib/action_mailer/preview.rb
Expand Up @@ -14,7 +14,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 06b185c

Please sign in to comment.