Sha256: 052cf682f1c8857789be93e57437720fbdaab894480d655b07dfe4494ce1e049

Contents?: true

Size: 720 Bytes

Versions: 3

Compression:

Stored size: 720 Bytes

Contents

module ActionMailer #:nodoc
  class Base #:nodoc:
    private
    def template_path_with_plugin_routing
      template_paths = [template_path_without_plugin_routing]
      Desert::Manager.plugins.reverse.each do |plugin|
        template_paths << "#{plugin.templates_path}/#{mailer_name}"
      end
      "{#{template_paths * ','}}"
    end
    alias_method_chain :template_path, :plugin_routing

    def initialize_template_class(assigns)
      base_path = Dir["#{template_path}/#{@template}.*"].first
      returning(template = ActionView::Base.new(File.dirname(base_path), assigns, self)) do
        template.extend ApplicationHelper
        template.extend self.class.master_helper_module
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
desert-0.1.1 lib/desert/plugin_templates/1.x/action_mailer.rb
desert-0.2.0 lib/desert/plugin_templates/1.2.0/action_mailer.rb
desert-0.2.1 lib/desert/plugin_templates/1.2.0/action_mailer.rb