Skip to content

Commit

Permalink
Run Mailer#prepare on initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Sep 23, 2015
1 parent 25e97bc commit 389d889
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/lotus/mailer.rb
Expand Up @@ -291,10 +291,6 @@ module InstanceMethods
#
# @since 0.1.0
def deliver
if self.respond_to? ('prepare')
self.prepare
end

mail.deliver
end
end
Expand Down
7 changes: 7 additions & 0 deletions lib/lotus/mailer/rendering.rb
Expand Up @@ -29,6 +29,8 @@ def initialize(locals = {})

m.delivery_method(*Lotus::Mailer.configuration.delivery_method)
end

prepare
end

# Render a single template with the specified format.
Expand All @@ -45,6 +47,11 @@ def render(format)
self.class.templates(format).render(self, @locals)
end

protected

def prepare
end

private

# @private
Expand Down

0 comments on commit 389d889

Please sign in to comment.