lib/roadie/action_mailer_extensions.rb in roadie-2.3.3 vs lib/roadie/action_mailer_extensions.rb in roadie-2.3.4

- old
+ new

@@ -27,11 +27,15 @@ end end def collect_responses_and_parts_order_with_inline_styles(headers, &block) responses, order = collect_responses_and_parts_order_without_inline_styles(headers, &block) - [responses.map { |response| inline_style_response(response) }, order] + if Roadie.enabled? + [responses.map { |response| inline_style_response(response) }, order] + else + [responses, order] + end end private def default_css_targets self.class.default[:css] @@ -48,10 +52,12 @@ def css_targets Array.wrap(@targets || []).map { |target| resolve_target(target) }.compact.map(&:to_s) end def resolve_target(target) - if target.respond_to? :call + if target.respond_to? :bind + target.bind(self).call + elsif target.respond_to? :call target.call else target end end