bullet_train-super_scaffolding 1.1.9 → 1.1.11

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: 5757550e765c797bad32aaea6112c0cc7252df6303d609d39e77029d06712808
4
- data.tar.gz: ff5bdc4e53e79af2fe45f13ae5b7111e3295d83a9b749044cde4544138931ded
3
+ metadata.gz: 849d916afdae1a5824183852091087660567803472670e264ca2021fe6908001
4
+ data.tar.gz: b60a0db182b2e0cb02837340d2ec12e6674a837a1e2b13f0e605638c676665d8
5
5
  SHA512:
6
- metadata.gz: 9d21775efaaecfe326d749478d1710b1d62219c125222754000f8a6864c0c954fd3019154d0bb6d1cc65bc96b8a26ad5dbd602df9464e93d5f9f9a118d97e419
7
- data.tar.gz: e4ee14ad18f88e986bc4024c52c3b0421d6591283a0feefd6594d6fd1222fd4f337b2912b0528bb406ba8b44a21ed6caeb3b9d548620ca7272a4e2486c1c23c7
6
+ metadata.gz: dcb8ada1b5aefc325b87f4dbb7ff5152abdcf6fc47c8775fe1c63df3739ed0a9b80af2cbe73015cdf2d0210a996ce11408b1975579f7cfee2cc137047a18e9e9
7
+ data.tar.gz: dc6d6ea38de0f48fb2b01487385342294946a22646e39717b0f22bed2f3402d68cb6a4df89814fdb30f5b395e9d9c6ad31d4263613d70ea4a20acbaf295d9c3d
@@ -0,0 +1,54 @@
1
+ class Api::V1::Scaffolding::AbsolutelyAbstract::CreativeConceptsController < Api::V1::ApplicationController
2
+ account_load_and_authorize_resource :creative_concept, through: :team, through_association: :scaffolding_absolutely_abstract_creative_concepts
3
+
4
+ # GET /api/v1/teams/:team_id/absolutely_abstract/creative_concepts
5
+ def index
6
+ end
7
+
8
+ # GET /api/v1/scaffolding/absolutely_abstract/creative_concepts/:id
9
+ def show
10
+ end
11
+
12
+ # POST /api/v1/teams/:team_id/absolutely_abstract/creative_concepts
13
+ def create
14
+ if @creative_concept.save
15
+ render :show, status: :created, location: [:api, :v1, @creative_concept]
16
+ else
17
+ render json: @creative_concept.errors, status: :unprocessable_entity
18
+ end
19
+ end
20
+
21
+ # PATCH/PUT /api/v1/scaffolding/absolutely_abstract/creative_concepts/:id
22
+ def update
23
+ if @creative_concept.update(creative_concept_params)
24
+ render :show
25
+ else
26
+ render json: @creative_concept.errors, status: :unprocessable_entity
27
+ end
28
+ end
29
+
30
+ # DELETE /api/v1/scaffolding/absolutely_abstract/creative_concepts/:id
31
+ def destroy
32
+ @creative_concept.destroy
33
+ end
34
+
35
+ private
36
+
37
+ module StrongParameters
38
+ # Only allow a list of trusted parameters through.
39
+ def creative_concept_params
40
+ strong_params = params.require(:scaffolding_absolutely_abstract_creative_concept).permit(
41
+ *permitted_fields,
42
+ :name,
43
+ :description,
44
+ *permitted_arrays
45
+ )
46
+
47
+ process_params(strong_params)
48
+
49
+ strong_params
50
+ end
51
+ end
52
+
53
+ include StrongParameters
54
+ end
@@ -0,0 +1,6 @@
1
+ json.extract! creative_concept,
2
+ :id,
3
+ :name,
4
+ :description,
5
+ :created_at,
6
+ :updated_at
@@ -0,0 +1 @@
1
+ json.array! @creative_concepts, partial: "api/v1/scaffolding/absolutely_abstract/creative_concepts/creative_concept", as: :creative_concept
@@ -0,0 +1 @@
1
+ json.partial! "api/v1/scaffolding/absolutely_abstract/creative_concepts/creative_concept", creative_concept: @creative_concept
@@ -1,5 +1 @@
1
- json.data do
2
- json.array! @tangible_things, partial: "api/v1/scaffolding/completely_concrete/tangible_things/tangible_thing", as: :tangible_thing
3
- end
4
-
5
- render_pagination(json)
1
+ json.array! @tangible_things, partial: "api/v1/scaffolding/completely_concrete/tangible_things/tangible_thing", as: :tangible_thing
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
- VERSION = "1.1.9"
3
+ VERSION = "1.1.11"
4
4
  end
5
5
  end
@@ -149,6 +149,17 @@ class Scaffolding::Transformer
149
149
  ].each do |needle|
150
150
  string = string.gsub(needle, encode_double_replacement_fix(class_names_transformer.replacement_for(needle)))
151
151
  end
152
+
153
+ {
154
+ "/v1/" => "/#{BulletTrain::Api.current_version}/",
155
+ "::V1::" => "::#{BulletTrain::Api.current_version}::",
156
+ "_v1_" => "_#{BulletTrain::Api.current_version}_",
157
+ ":v1," => ":#{BulletTrain::Api.current_version},"
158
+ }.each do |from, to|
159
+ string = string.gsub(from.upcase, encode_double_replacement_fix(to.upcase))
160
+ string = string.gsub(from.downcase, encode_double_replacement_fix(to.downcase))
161
+ end
162
+
152
163
  decode_double_replacement_fix(string)
153
164
  end
154
165
 
@@ -1086,6 +1097,10 @@ class Scaffolding::Transformer
1086
1097
  #
1087
1098
 
1088
1099
  unless cli_options["skip-api"]
1100
+ # We always want to suppress this error for this file, since it doesn't exist by default. We reset this below.
1101
+ suppress_could_not_find_state = suppress_could_not_find
1102
+ self.suppress_could_not_find = true
1103
+
1089
1104
  # It's OK that this won't be found most of the time.
1090
1105
  scaffold_add_line_to_file(
1091
1106
  "./app/views/api/v1/open_api/scaffolding/completely_concrete/tangible_things/_components.yaml.erb",
@@ -1101,6 +1116,8 @@ class Scaffolding::Transformer
1101
1116
  "<%# 🚅 super scaffolding will insert new parameter above this line. %>",
1102
1117
  prepend: true
1103
1118
  )
1119
+
1120
+ self.suppress_could_not_find = suppress_could_not_find_state
1104
1121
  end
1105
1122
 
1106
1123
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-super_scaffolding
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.9
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-14 00:00:00.000000000 Z
11
+ date: 2022-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -85,6 +85,7 @@ files:
85
85
  - app/controllers/api/v1.rb
86
86
  - app/controllers/api/v1/scaffolding.rb
87
87
  - app/controllers/api/v1/scaffolding/absolutely_abstract.rb
88
+ - app/controllers/api/v1/scaffolding/absolutely_abstract/creative_concepts_controller.rb
88
89
  - app/controllers/api/v1/scaffolding/completely_concrete.rb
89
90
  - app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller.rb
90
91
  - app/controllers/concerns/scaffolding/absolutely_abstract/creative_concepts/controller_support.rb
@@ -130,6 +131,9 @@ files:
130
131
  - app/views/account/scaffolding/completely_concrete/tangible_things/show.html.erb
131
132
  - app/views/api/v1/open_api/scaffolding/completely_concrete/tangible_things/_components.yaml.erb
132
133
  - app/views/api/v1/open_api/scaffolding/completely_concrete/tangible_things/_paths.yaml.erb
134
+ - app/views/api/v1/scaffolding/absolutely_abstract/creative_concepts/_creative_concept.json.jbuilder
135
+ - app/views/api/v1/scaffolding/absolutely_abstract/creative_concepts/index.json.jbuilder
136
+ - app/views/api/v1/scaffolding/absolutely_abstract/creative_concepts/show.json.jbuilder
133
137
  - app/views/api/v1/scaffolding/completely_concrete/tangible_things/_tangible_thing.json.jbuilder
134
138
  - app/views/api/v1/scaffolding/completely_concrete/tangible_things/index.json.jbuilder
135
139
  - app/views/api/v1/scaffolding/completely_concrete/tangible_things/show.json.jbuilder