short_message 1.1.0 → 1.1.1
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/app/models/short_message/message.rb +4 -3
- data/lib/short_message/version.rb +1 -1
- data/test/dummy/log/development.log +0 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d535fac6775fb6f8d7c3c72e487297fb79c735d
|
4
|
+
data.tar.gz: be81a206a9b2498a0ac011cbcaeca70d31aeb730
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c54fae79d7f988c911a7db607b3a24c034abbd42a3f35038d3619c9637b39507ab1414f8502fa0fd53e950950f7e0b6641b4b1bc94f2be53cd08531df5c5ab9
|
7
|
+
data.tar.gz: a7907a2d43c22ca773a3aa075a733226569efe0219f0a610fef38b0a34a694f0aede2f3d4144cb9633ea853267547e27c2c206690b77441e74f2c6b049ada21e
|
@@ -1,8 +1,9 @@
|
|
1
1
|
module ShortMessage
|
2
2
|
class Message < ActiveRecord::Base
|
3
3
|
def deliver
|
4
|
-
|
4
|
+
deliver_method = Rails.version.to_f > 4.2 ? "deliver_now" : "deliver"
|
5
5
|
|
6
|
+
self.sender = ShortMessage.config.default_sms_sender if self.sender.blank?
|
6
7
|
unless self.recipient.blank? and self.text.blank?
|
7
8
|
http = Net::HTTP.new(ShortMessage.config.gateway_server, ShortMessage.config.gateway_port)
|
8
9
|
if ShortMessage.config.gateway_port == Net::HTTP.https_default_port()
|
@@ -16,14 +17,14 @@ module ShortMessage
|
|
16
17
|
|
17
18
|
if response_code == 200 or response_code == 402
|
18
19
|
if response_code == 402 and not ShortMessage.config.reload_notification_email.blank?
|
19
|
-
ShortMessage::Mailer.payment_required_notification(
|
20
|
+
eval "ShortMessage::Mailer.payment_required_notification().#{deliver_method}"
|
20
21
|
end
|
21
22
|
|
22
23
|
self.message_key = result_set[2] unless result_set[2].blank?
|
23
24
|
ActiveSupport::Notifications.instrument('short_message.delivered', options: { key: (result_set[2] unless result_set[2].blank?) })
|
24
25
|
return self.save
|
25
26
|
else
|
26
|
-
ShortMessage::Mailer.error_notification(self, response)
|
27
|
+
eval "ShortMessage::Mailer.error_notification(self, response).#{deliver_method}" unless ShortMessage.config.admin_notification_email.blank?
|
27
28
|
end
|
28
29
|
else
|
29
30
|
return false
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: short_message
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andi Saurer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- test/dummy/config/locales/en.yml
|
96
96
|
- test/dummy/config/routes.rb
|
97
97
|
- test/dummy/config/secrets.yml
|
98
|
+
- test/dummy/log/development.log
|
98
99
|
- test/dummy/public/404.html
|
99
100
|
- test/dummy/public/422.html
|
100
101
|
- test/dummy/public/500.html
|
@@ -155,6 +156,7 @@ test_files:
|
|
155
156
|
- test/dummy/config/routes.rb
|
156
157
|
- test/dummy/config/secrets.yml
|
157
158
|
- test/dummy/config.ru
|
159
|
+
- test/dummy/log/development.log
|
158
160
|
- test/dummy/public/404.html
|
159
161
|
- test/dummy/public/422.html
|
160
162
|
- test/dummy/public/500.html
|