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: 51746c1a3b84cf591581ecb49d4ae9894066ffbe242c9542e812dfbc8942ea6a
4
- data.tar.gz: 3f1d5dafff1340d8c688d65d3f50322b9e9737b251b6171dd1ff9529a7b968f1
3
+ metadata.gz: 1806427fae0e5cd7d5f9affa3e027d0c917d29fc9596fe3ce13e25145a462659
4
+ data.tar.gz: dbfab0be607282b69ee6bd50461d3dfcca7d40a2d6cb81d85e09694225fe4cd6
5
5
  SHA512:
6
- metadata.gz: 30c8f67f96ce8375e889e3ad9826d5bbc86869b9fb2d64ac50cced67b6c80a8aa404bc9738bbab22a461c09229b0a5e08fce105a77d0fc8a2eca7d067bdefba3
7
- data.tar.gz: 3ee4761dd3c33bde4747e1eb6fd55983a61acffbb74db7ddf656df578c1a5c79d0f783b5e4b4e9872e00eba4f70ae05c7bc5eaf6fc5723aa476c255c60c5d789
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
- if (get_example = FactoryBot.get_example(model_symbol, version: @version))
44
- output.gsub!("🚅 get_example", get_example)
45
- end
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
- 🚅 get_example
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
- 🚅 post_examples
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 post_examples post_parameters put_example put_parameters patch_example patch_parameters].each do |method|
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
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module Api
3
- VERSION = "1.3.11"
3
+ VERSION = "1.3.13"
4
4
  end
5
5
  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.11
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-22 00:00:00.000000000 Z
11
+ date: 2023-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard