bullet_train-api 1.3.11 → 1.3.13
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: 1806427fae0e5cd7d5f9affa3e027d0c917d29fc9596fe3ce13e25145a462659
|
4
|
+
data.tar.gz: dbfab0be607282b69ee6bd50461d3dfcca7d40a2d6cb81d85e09694225fe4cd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5ecb7a22849f2e5a85d7b982f5594211f595fccfda892803f034b33c725997fbc439c3a9a296ef2be9cc812560ab2ca75c0dcda4fb0c4f080b62f04e359f5ca
|
7
|
+
data.tar.gz: cb4b9abd99ea3782b991f14c2c231be60621db40c6738153f1bdd3285f4bfcec308ac2ca4484d36b5e6ce7386bec0f0f15977aaade0f350e260b9961c68242ba
|
@@ -40,24 +40,10 @@ module Api
|
|
40
40
|
# There are some placeholders specific to this method that we still need to transform.
|
41
41
|
model_symbol = model.name.underscore.tr("/", "_").to_sym
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
if (post_parameters = FactoryBot.post_parameters(model_symbol, version: @version))
|
48
|
-
output.gsub!("🚅 post_parameters", post_parameters)
|
49
|
-
end
|
50
|
-
|
51
|
-
if (post_examples = FactoryBot.post_examples(model_symbol, version: @version))
|
52
|
-
output.gsub!("🚅 post_examples", post_examples)
|
53
|
-
end
|
54
|
-
|
55
|
-
if (put_parameters = FactoryBot.put_parameters(model_symbol, version: @version))
|
56
|
-
output.gsub!("🚅 put_parameters", put_parameters)
|
57
|
-
end
|
58
|
-
|
59
|
-
if (put_example = FactoryBot.put_example(model_symbol, version: @version))
|
60
|
-
output.gsub!("🚅 put_example", put_example)
|
43
|
+
FactoryBot::ExampleBot::REST_METHODS.each do |method|
|
44
|
+
if (code = FactoryBot.send(method, model_symbol, version: @version))
|
45
|
+
output.gsub!("🚅 #{method}", code)
|
46
|
+
end
|
61
47
|
end
|
62
48
|
|
63
49
|
indent(output, 1)
|
@@ -34,7 +34,7 @@ class Platform::Application < BulletTrain::Api.base_class.constantize
|
|
34
34
|
def create_user_and_membership
|
35
35
|
faux_password = SecureRandom.hex
|
36
36
|
create_user(email: "noreply+#{SecureRandom.hex}@bullettrain.co", password: faux_password, password_confirmation: faux_password, first_name: label_string)
|
37
|
-
create_membership(team: team, user: user, platform_agent: true)
|
37
|
+
create_membership(team: team, user: user, user_email: user.email, platform_agent: true)
|
38
38
|
membership.roles << Role.admin
|
39
39
|
end
|
40
40
|
|
@@ -31,7 +31,7 @@
|
|
31
31
|
items:
|
32
32
|
$ref: "#/components/schemas/ScaffoldingCompletelyConcreteTangibleThingAttributes"
|
33
33
|
example:
|
34
|
-
🚅
|
34
|
+
🚅 get_examples
|
35
35
|
<% end %>
|
36
36
|
<% unless except.include?(:create) %>
|
37
37
|
post:
|
@@ -68,7 +68,7 @@
|
|
68
68
|
schema:
|
69
69
|
$ref: "#/components/schemas/ScaffoldingCompletelyConcreteTangibleThingAttributes"
|
70
70
|
example:
|
71
|
-
🚅
|
71
|
+
🚅 post_example
|
72
72
|
<% end %>
|
73
73
|
<% end %>
|
74
74
|
<% unless except.include?(:show) && except.include?(:update) && except.include?(:destroy) %>
|
@@ -39,7 +39,9 @@ module FactoryBot
|
|
39
39
|
objects
|
40
40
|
end
|
41
41
|
|
42
|
-
%i[get_examples get_example
|
42
|
+
REST_METHODS = %i[get_examples get_example post_example post_parameters put_example put_parameters patch_example patch_parameters]
|
43
|
+
|
44
|
+
REST_METHODS.each do |method|
|
43
45
|
define_method(method) do |model, **options|
|
44
46
|
_path_examples(method.to_s, model, **options)
|
45
47
|
end
|
@@ -53,6 +55,8 @@ module FactoryBot
|
|
53
55
|
end
|
54
56
|
|
55
57
|
def reset_tables!
|
58
|
+
# This is only availble for postgres
|
59
|
+
return unless ActiveRecord::Base.connection.respond_to?(:reset_pk_sequence!)
|
56
60
|
@tables_to_reset.each do |name|
|
57
61
|
ActiveRecord::Base.connection.reset_pk_sequence!(name) if ActiveRecord::Base.connection.table_exists?(name)
|
58
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|