effective_email_templates 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76b4cba485f59818cdff525e1a105ce1e61e82741b416291ea48721da04ac148
4
- data.tar.gz: 96dabdd42fa0e1dc26a6e1c7fbe497f471ba06b67234f852ba3ca41816ccf58e
3
+ metadata.gz: f6f761daef6975677ea045c02bec4fe35c12613428d7a471ea96090d9ff4f8ee
4
+ data.tar.gz: 643bb762e01e5f086d90fe91465dc150033f27e2cd913f3295b02c1d35e0cff0
5
5
  SHA512:
6
- metadata.gz: 54dbf79839ab5bc46073a9aeb59ae30de17c89a6b5e7d0efaf54f5703c9761118f8e8713f0cc4fbe2acfc066c5ebdc9be4f307433cce9680d73e89eced6ca409
7
- data.tar.gz: baed2e7069b501209ba92605dd023c4f18d4e8dcbf79861b195c15c268cbc5d7d8025b14ff27a07473a9a46a99dae26b55ef446df46cf02553dc288916dd7be5
6
+ metadata.gz: d516cd29cdbf67641658d726e3d6ac3c670d25f1a563827516e05f8bb78aeb31c316f3270c4cdf981d74cd5d0efb8f980bb4035b6bdca61738000f4a344b7d20
7
+ data.tar.gz: 1e10e8b93b994cbbb3a8b715a97d039648655cd2f307fbbdf5cf3caafae73fd4c735ead6a8461e9e5c209a00ddb5dc4dc9d773919192d92a29d1b5a1d3cfe8d1
@@ -18,7 +18,7 @@ module EffectiveEmailTemplatesMailer
18
18
  email_template.subject = subject if subject.present?
19
19
 
20
20
  # Add any _url helpers
21
- assigns = route_url_assigns(email_template).merge(assigns)
21
+ assigns = route_url_assigns(email_template, assigns).merge(assigns)
22
22
 
23
23
  # Render from the template, possibly with updated body
24
24
  rendered = email_template.render(assigns)
@@ -28,8 +28,12 @@ module EffectiveEmailTemplatesMailer
28
28
 
29
29
  private
30
30
 
31
- def route_url_assigns(email_template)
32
- email_template.template_variables.select { |name| name.ends_with?('_url') }.inject({}) do |h, name|
31
+ def route_url_assigns(email_template, existing)
32
+ route_variables = email_template.template_variables
33
+ .select { |name| name.ends_with?('_url') }
34
+ .reject { |name| existing.key?(name) || existing.key?(name.to_sym) }
35
+
36
+ route_variables.inject({}) do |h, name|
33
37
  h[name] = public_send(name) if respond_to?(name); h
34
38
  end
35
39
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveEmailTemplates
2
- VERSION = '1.4.0'.freeze
2
+ VERSION = '1.4.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_email_templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-24 00:00:00.000000000 Z
11
+ date: 2023-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails