stockpot 0.1.6 → 0.2.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10ea191928ef5ce7022fd46db9b0eef2ec26b76389ff759f35756d799de301b4
|
4
|
+
data.tar.gz: 7ea77403ffbd2713158a6c556b8bcf1c6ab14f21250bc9a3abf8813b3f629ffa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7591612674a3ba21d9e9ac4046ad5124025c3f48d5d0fe0f6eb2199adc4436bdc6edaf06b838d036e3414d649f40c6622390ae7d2c6b7828c486724bdf9c1c0
|
7
|
+
data.tar.gz: 5e2d0f6a1275fd5985346b20efe5d16d15e3520246a5097ac0d2082396a48acae2a44937097332190256960befe106ac7fbb50a82d6f5e3e967016dd98cb87a0
|
@@ -17,7 +17,7 @@ module Stockpot
|
|
17
17
|
obj[pluralize(model).camelize(:lower)] = model.camelize.constantize.where(models[i].except(:model))
|
18
18
|
end
|
19
19
|
|
20
|
-
render json: obj
|
20
|
+
render json: obj, status: :ok
|
21
21
|
end
|
22
22
|
|
23
23
|
def create
|
@@ -28,7 +28,9 @@ module Stockpot
|
|
28
28
|
if params[:traits].present? && params[:attributes].present?
|
29
29
|
FactoryBot.create(factory, *traits, attributes[n])
|
30
30
|
elsif params[:traits].blank? && params[:attributes].blank?
|
31
|
-
|
31
|
+
# rubocop:disable Rails/SaveBang
|
32
|
+
FactoryBot.create(factory)
|
33
|
+
# rubocop:enable Rails/SaveBang
|
32
34
|
elsif params[:attributes].blank?
|
33
35
|
FactoryBot.create(factory, *traits)
|
34
36
|
elsif params[:traits].blank?
|
@@ -36,7 +38,7 @@ module Stockpot
|
|
36
38
|
end
|
37
39
|
end
|
38
40
|
obj = factory.to_s.camelize.constantize.last(list)
|
39
|
-
render json: obj
|
41
|
+
render json: obj, status: :created
|
40
42
|
end
|
41
43
|
|
42
44
|
def destroy
|
@@ -48,7 +50,7 @@ module Stockpot
|
|
48
50
|
obj[pluralize(model).camelize(:lower)] = model.camelize.constantize.where(models[i].except(:model)).destroy_all
|
49
51
|
end
|
50
52
|
|
51
|
-
render json: obj
|
53
|
+
render json: obj, status: :accepted
|
52
54
|
end
|
53
55
|
|
54
56
|
def update
|
@@ -61,7 +63,7 @@ module Stockpot
|
|
61
63
|
obj[pluralize(model).camelize(:lower)] = model.camelize.constantize.where(models[i].except(:model, :update)).update(update_params)
|
62
64
|
end
|
63
65
|
|
64
|
-
render json: obj
|
66
|
+
render json: obj, status: :accepted
|
65
67
|
end
|
66
68
|
|
67
69
|
private
|
data/config/routes.rb
CHANGED
data/lib/stockpot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stockpot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jayson Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -215,6 +215,7 @@ files:
|
|
215
215
|
- Rakefile
|
216
216
|
- app/controllers/stockpot/application_controller.rb
|
217
217
|
- app/controllers/stockpot/database_cleaner_controller.rb
|
218
|
+
- app/controllers/stockpot/healthz_controller.rb
|
218
219
|
- app/controllers/stockpot/records_controller.rb
|
219
220
|
- app/controllers/stockpot/redis_controller.rb
|
220
221
|
- config/routes.rb
|