zoho_invoice 0.3.5 → 0.3.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zoho_invoice/base.rb +6 -4
- data/lib/zoho_invoice/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be61def063a3989ceae927f8f1c5c5e692581e0b
|
4
|
+
data.tar.gz: 406ca99386eb3bd893c0a7e6088c3a79480af2b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf9fb3ff087be36d4dcc0c6feba5dd6b2f55638152242e58173762319b2ee52399eab618c818313083d37a02a49b5340c1946287c0ed19bf8cc8849e02ec4237
|
7
|
+
data.tar.gz: 27c8c9a27784cdaca450f93ac8b017022d1e21ada372d4ef04cb0424d2e57e086f8ea0b45b9c24b5ce78fae496c54c0563b5382892b4b53e5c23b6279e2966a9
|
data/lib/zoho_invoice/base.rb
CHANGED
@@ -77,13 +77,15 @@ module ZohoInvoice
|
|
77
77
|
#
|
78
78
|
def save
|
79
79
|
|
80
|
+
klass_name = self.class.to_s.split('::').last
|
81
|
+
|
80
82
|
action = 'create'
|
81
|
-
action = 'update' if !send("#{
|
83
|
+
action = 'update' if !send("#{klass_name.downcase}_id").nil?
|
82
84
|
|
83
|
-
result = client.post("/api/#{
|
85
|
+
result = client.post("/api/#{klass_name.downcase + 's'}/#{action}", :XMLString => self.to_xml)
|
84
86
|
|
85
|
-
if action == 'create' && !result.body.nil? && !result.body['Response'][
|
86
|
-
self.send("#{self.class.to_s.downcase}_id=", result.body['Response'][
|
87
|
+
if action == 'create' && !result.body.nil? && !result.body['Response'][klass_name].nil?
|
88
|
+
self.send("#{self.class.to_s.downcase}_id=", result.body['Response'][klass_name]["#{klass_name}ID"])
|
87
89
|
end
|
88
90
|
|
89
91
|
self
|
data/lib/zoho_invoice/version.rb
CHANGED