intacctrb 0.8 → 0.8.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: 25f611a980b22b7214b5a76a9ca1d0f8a9c0f1c6b4d485b3525b26b4985f4035
4
- data.tar.gz: 0fcd8251ad8f2483ec63d403edb1afb6a72b848b864898518f8864de3389c1c2
3
+ metadata.gz: 85d2a0530dd2439819c4affc9d598cf27f95cef62460fc9e78f98327741635c3
4
+ data.tar.gz: a8dac39c1c61d8f8bdcef1fa47eae8245d0a248ec8fdb5c6e6ea8d19c529daae
5
5
  SHA512:
6
- metadata.gz: 5de26eb17bc292f2dadd4d5e4b40eca204b3a0fc05eb7d8105c56d1437e43631a2ba04a20e2e8eb1d72721a2f899e6e1d1956a83ffaf4be801674f8a88253408
7
- data.tar.gz: 909abda7efcf9de11a1605b35a199b4796e09531d051fd562aa7efb990c9f60845dbbd1671b1fc58384b754683770507aee82df5752dfdd4e47f95fdc6785935
6
+ metadata.gz: 1043d711e9945cd3d59132800c59997f9d3c6c47ced936a5039e002746cf85905b77f8e512ed903bc5a0cc7c569b9c272128599fbcfed0666bb02da3470d420b
7
+ data.tar.gz: 4b7ecbd39d2b8c037b102e4236a8b36b6fa2466e34dcd8caa5ca9c598f9946d0afe243003fc6e6412790b1f32db37a980d94a1355c394edbe9d2d22f2ba7b595
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- intacctrb (0.8)
4
+ intacctrb (0.8.1)
5
5
  hooks
6
6
  nokogiri
7
7
 
@@ -105,7 +105,7 @@ module IntacctRB
105
105
  data = OpenStruct.new({result: true, intacct_id: object.intacct_id,
106
106
  object: response, data: data})
107
107
  else
108
- data = OpenStruct.new({result: false})
108
+ data = OpenStruct.new({result: false, intacct_id: object.intacct_id})
109
109
  data.errors = {}
110
110
  response.xpath("//result/errormessage/error").each do |error|
111
111
  data.errors << {
@@ -2,33 +2,37 @@ module IntacctRB
2
2
  class JournalEntry < IntacctRB::Base
3
3
 
4
4
  def create
5
- return false if object.intacct_id.present?
6
- send_xml('create') do |xml|
7
- xml.function(controlid: "f1") {
8
- xml.send("create") {
9
- xml.glbatch {
10
- je_xml xml
5
+ if object.intacct_id.present?
6
+ return_error('You tried to create an object that already had an intacct_id')
7
+ else
8
+ send_xml('create') do |xml|
9
+ xml.function(controlid: "f1") {
10
+ xml.send("create") {
11
+ xml.glbatch {
12
+ je_xml xml
13
+ }
11
14
  }
12
15
  }
13
- }
16
+ end
17
+ return_result(response)
14
18
  end
15
-
16
- return_result(response)
17
19
  end
18
20
 
19
21
  def update
20
- return false unless object.intacct_id.present?
21
- send_xml('update') do |xml|
22
- xml.function(controlid: "f1") {
23
- xml.send("update") {
24
- xml.glbatch {
25
- je_xml xml
22
+ unless object.intacct_id.present?
23
+ return_error('You tried to update an object without an intacct_id')
24
+ else
25
+ send_xml('update') do |xml|
26
+ xml.function(controlid: "f1") {
27
+ xml.send("update") {
28
+ xml.glbatch {
29
+ je_xml xml
30
+ }
26
31
  }
27
32
  }
28
- }
33
+ end
34
+ return_result(response)
29
35
  end
30
-
31
- return_result(response)
32
36
  end
33
37
 
34
38
  # def delete
@@ -1,3 +1,3 @@
1
1
  module IntacctRB
2
- VERSION = "0.8"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intacctrb
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.8'
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Hale