actionmessage 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/action_message/base.rb +10 -4
- data/lib/action_message/message_delivery.rb +1 -0
- data/lib/action_message/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42357eef800261fa0c18309e5b38be909f30fee5
|
4
|
+
data.tar.gz: d9738068be505c14c21b415faac5a100df7bfab1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9abd30a248ca8438fd50ba3c55c4cafefc19418ea8d79a9c221c45e09c1d620a1aeac5d13f872e6f90d5d588c92144d65b12d68cfc4d523ba37adc4f0be191f
|
7
|
+
data.tar.gz: 0fa6acbab9243bd7fafe5db55594feb1cb8702ff6718a8053963f0955fad03edb4f29e6db9af444ee03b1bb559dd26b25868b613f3dd736c7a184b22d5d237d2
|
data/lib/action_message/base.rb
CHANGED
@@ -53,7 +53,7 @@ module ActionMessage
|
|
53
53
|
end
|
54
54
|
|
55
55
|
attr_internal :message
|
56
|
-
attr_accessor :template_name
|
56
|
+
attr_accessor :template_name, :template_path
|
57
57
|
|
58
58
|
def initialize
|
59
59
|
super
|
@@ -64,16 +64,22 @@ module ActionMessage
|
|
64
64
|
def sms(params = {}, &block)
|
65
65
|
raise ArgumentError, 'You need to provide at least a receipient' if params[:to].blank?
|
66
66
|
return message if @_message_was_called && !block
|
67
|
+
|
68
|
+
self.template_name = params[:template_name].presence || template_name
|
69
|
+
self.template_path = params[:template_path].presence || template_path
|
67
70
|
|
68
71
|
@_message_was_called = true
|
69
|
-
|
70
|
-
lookup_context.view_paths = (lookup_context.view_paths.to_a + self.class.base_paths).uniq
|
72
|
+
lookup_context.view_paths = (lookup_context.view_paths.to_a + self.class.base_paths).flatten.uniq
|
71
73
|
|
72
74
|
message.to = params[:to]
|
73
75
|
message.debug = params[:debug]
|
74
|
-
message.body = render(
|
76
|
+
message.body = render(full_template_path)
|
75
77
|
|
76
78
|
message
|
77
79
|
end
|
80
|
+
|
81
|
+
def full_template_path
|
82
|
+
[template_path, template_name].join('/')
|
83
|
+
end
|
78
84
|
end
|
79
85
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmessage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Ballona
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|