lockstep_rails 0.3.64 → 0.3.65

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: d83e57b6db6e9db14cd4f15009562ccd5d0d04efa90a70b06f5f60a58ac53f40
4
- data.tar.gz: c4830314919f4710198deb5e2931808ed9b6533d727eb992ba4d1532473ff427
3
+ metadata.gz: ffc2c21371e280e4b0d300d21a889b1e9604ea20868527c470cdd21858fe8c05
4
+ data.tar.gz: 2d3f226fe569acb51bf9b9ceddd2eb22c7f7ebaa3ba7e5f8d15ef78043d6c28f
5
5
  SHA512:
6
- metadata.gz: 70ce01db3c9b2e45047839ab02ca21dc01f82a781c0b2489dc320931b3774c4d8c720aa2665cc142738dd6892ea92f53f708233fee0758f1a29fa14eab20a89c
7
- data.tar.gz: 58b0d4ed3f52e6c72a1bd3d52f9b3eaf10b8cf5853e03720d9927f33fb4af2eb8e10362821cf43ea621d0d151bcf314a5975580de01b5526552e2169e506e68c
6
+ metadata.gz: '018b416e5c30156f70cc03d864ff72d112439d4aa552e174e59f8e414b3fc36a6a0809c2ff4c447c2b7b382361d3d3bcb0cfc763c2080f3dec1e2ae28d5829ee'
7
+ data.tar.gz: 6b3cb5bf9430de1269912ebbac07387f25e46806b9cc62ab6a539783a305049f8dfd9ee2513dc0d71a4edf5d55a406fd4c811579c47173fb6d88eed65e3b3894
@@ -2,6 +2,21 @@ class Lockstep::Payment < Lockstep::ApiRecord
2
2
  self.model_name_uri = "v1/Payments"
3
3
  self.id_ref = "payment_id"
4
4
  load_schema(Schema::Payment)
5
-
5
+ ERP_WRITE = "erp_write"
6
+ ERP_WRITE_PATH_PARAMS = "erp-write"
6
7
  belongs_to :connection, class_name: "Lockstep::Connection", foreign_key: :company_id
8
+
9
+ # Overriding create to support erp-write in path params
10
+ def create
11
+ if attributes_for_saving.key?(ERP_WRITE)
12
+ attributes_for_saving.delete(ERP_WRITE)
13
+ attrs = attributes_for_saving.transform_keys { |key| key.camelize(:lower) }
14
+ resp = resource.post(ERP_WRITE_PATH_PARAMS, body: attrs)
15
+ result = post_result(resp)
16
+ else
17
+ attrs = attributes_for_saving.transform_keys { |key| key.camelize(:lower) }
18
+ resp = resource.post('', body: [attrs])
19
+ result = post_result(resp)
20
+ end
21
+ end
7
22
  end
@@ -1,3 +1,3 @@
1
1
  module LockstepRails
2
- VERSION = '0.3.64'
2
+ VERSION = '0.3.65'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockstep_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.64
4
+ version: 0.3.65
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vivek AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-09 00:00:00.000000000 Z
11
+ date: 2023-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails