lockstep_rails 0.3.63 → 0.3.64
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/README.md +8 -0
- data/app/concepts/lockstep/api_record.rb +12 -7
- data/app/concepts/lockstep/client.rb +2 -2
- data/lib/lockstep_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d83e57b6db6e9db14cd4f15009562ccd5d0d04efa90a70b06f5f60a58ac53f40
|
4
|
+
data.tar.gz: c4830314919f4710198deb5e2931808ed9b6533d727eb992ba4d1532473ff427
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70ce01db3c9b2e45047839ab02ca21dc01f82a781c0b2489dc320931b3774c4d8c720aa2665cc142738dd6892ea92f53f708233fee0758f1a29fa14eab20a89c
|
7
|
+
data.tar.gz: 58b0d4ed3f52e6c72a1bd3d52f9b3eaf10b8cf5853e03720d9927f33fb4af2eb8e10362821cf43ea621d0d151bcf314a5975580de01b5526552e2169e506e68c
|
data/README.md
CHANGED
@@ -166,6 +166,14 @@ if you wish, you can always write raw [Searchlight](https://developer.lockstep.i
|
|
166
166
|
Lockstep::Connection.where("isActive is true OR default_currency_code in ('USD', 'INR')").execute
|
167
167
|
```
|
168
168
|
|
169
|
+
### Destroy and Destroy all
|
170
|
+
You can destroy a single object by calling destroy method on one object
|
171
|
+
Lockstep::Connection.find(company_id: "17544da8-7be8-4ee2-8c62-cbd81428c68b").destroy
|
172
|
+
|
173
|
+
You can also destroy multiple objects at once by calling it on the model class and passing an array of relevant ids
|
174
|
+
|
175
|
+
Lockstep::Connection.destroy_all(id: ["17544da8-7be8-4ee2-8c62-cbd81428c68b"])
|
176
|
+
|
169
177
|
### Count
|
170
178
|
You can fetch the count of available records by calling `count`
|
171
179
|
|
@@ -572,13 +572,6 @@ module Lockstep
|
|
572
572
|
obj
|
573
573
|
end
|
574
574
|
|
575
|
-
# Replaced with a batch destroy_all method.
|
576
|
-
# def self.destroy_all(all)
|
577
|
-
# all.each do |object|
|
578
|
-
# object.destroy
|
579
|
-
# end
|
580
|
-
# end
|
581
|
-
|
582
575
|
def self.class_attributes
|
583
576
|
@class_attributes ||= {}
|
584
577
|
end
|
@@ -822,6 +815,18 @@ module Lockstep
|
|
822
815
|
false
|
823
816
|
end
|
824
817
|
|
818
|
+
def self.destroy_all(id: [])
|
819
|
+
id.each_slice(100) do |sliced_ids|
|
820
|
+
resp = resource.delete('', body: { 'idsToDelete' => sliced_ids })
|
821
|
+
return false unless resp.code.to_s == '200'
|
822
|
+
# TODO: Since this could fail for certain IDs return deleted_ids in batch
|
823
|
+
end
|
824
|
+
|
825
|
+
@attributes = {}
|
826
|
+
@unsaved_attributes = {}
|
827
|
+
return true
|
828
|
+
end
|
829
|
+
|
825
830
|
def reload
|
826
831
|
return false if new?
|
827
832
|
|
@@ -159,8 +159,8 @@ module Lockstep
|
|
159
159
|
request(:put, path, body, params)
|
160
160
|
end
|
161
161
|
|
162
|
-
def delete(path)
|
163
|
-
request(:delete, path,
|
162
|
+
def delete(path, body: {})
|
163
|
+
request(:delete, path, body, {})
|
164
164
|
end
|
165
165
|
|
166
166
|
def post_magic_link(path, body: {}, params: {})
|
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.
|
4
|
+
version: 0.3.64
|
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-
|
11
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|