zoho_invoice 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/zoho_invoice/base.rb +2 -2
- data/lib/zoho_invoice/version.rb +1 -1
- metadata +1 -1
data/lib/zoho_invoice/base.rb
CHANGED
@@ -94,9 +94,9 @@ module ZohoInvoice
|
|
94
94
|
@errors = []
|
95
95
|
|
96
96
|
action = 'create'
|
97
|
-
action = 'update' if !send("#{self.class.to_s.downcase}_id").nil?
|
97
|
+
action = 'update' if !send("#{self.class.to_s.split('::').last.downcase}_id").nil?
|
98
98
|
|
99
|
-
result = client.post("/api/#{self.class.to_s.downcase + 's'}/#{action}", :XMLString => self.to_xml)
|
99
|
+
result = client.post("/api/#{self.class.to_s.split('::').last.downcase + 's'}/#{action}", :XMLString => self.to_xml)
|
100
100
|
|
101
101
|
if action == 'create' && !result.body.nil? && !result.body[self.class.to_s].nil?
|
102
102
|
self.send("#{self.class.to_s.downcase}_id=", result.body[self.class.to_s]["#{self.class}ID"])
|
data/lib/zoho_invoice/version.rb
CHANGED