bullet_train-super_scaffolding-templates 1.0.0 → 1.0.4

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: 799004993a3b6d6944ac0b938360c4403aac4c73a3475e53e16aa5dc26f57f6a
4
- data.tar.gz: d7b253fd1d5a88a62e6973fb6ea48f8a5d4b240819b466106c0a920869429395
3
+ metadata.gz: 7e3deda7c521320104088d57d2d5572b29a033a4258e7833998bf6d9a065f83c
4
+ data.tar.gz: 3d44b37ccdc308b5c0938562491747f205a64e8ea27116ad0320d9b64578331c
5
5
  SHA512:
6
- metadata.gz: 919ece0a94a00faabca72f04d6e19d3eb2463576fe8918aebff47564d8c0b45a291234c59fca51d3ae7d36c88fa98814621bfe19d2c9d89f3d59935a64dc38d5
7
- data.tar.gz: '03865ca5306ec1640839ffed47870b46211c8f03cd9c67de28a5fe20ba17a4b88cdf88ee266389acf2a83b2ad49a8ec89620adcf29f5a9b97a2ec6286d3f41ca'
6
+ metadata.gz: 1b94b2f08bf8edb862dfd13ae86ced92d6c953aed57a39856188de16dd62baa973c42485dde41abcaea951a5d37377bb9fba2cc5f8bbf4bebafe322136891bff
7
+ data.tar.gz: 6edcfcc3695099ddfc6bb26fc5e2bcda5b124ce333742b8c5c822550a4fd33899e1d83f3c6057990d3ed7e6399526ba147d2d82499020b3bd289fd1f3d381c91
@@ -69,7 +69,7 @@ class Account::Scaffolding::AbsolutelyAbstract::CreativeConcepts::CollaboratorsC
69
69
  strong_params = params.require(:scaffolding_absolutely_abstract_creative_concepts_collaborator).permit(
70
70
  :membership_id,
71
71
  # 🚅 super scaffolding will insert new fields above this line.
72
- role_ids: [],
72
+ role_ids: []
73
73
  # 🚅 super scaffolding will insert new arrays above this line.
74
74
  )
75
75
 
@@ -70,15 +70,13 @@ class Account::Scaffolding::AbsolutelyAbstract::CreativeConceptsController < Acc
70
70
 
71
71
  # Never trust parameters from the scary internet, only allow the white list through.
72
72
  def creative_concept_params
73
- strong_params = params.require(:scaffolding_absolutely_abstract_creative_concept).permit(
73
+ params.require(:scaffolding_absolutely_abstract_creative_concept).permit(
74
74
  :name,
75
- :description,
75
+ :description
76
76
  # 🚅 super scaffolding will insert new fields above this line.
77
77
  # 🚅 super scaffolding will insert new arrays above this line.
78
78
  )
79
79
 
80
80
  # 🚅 super scaffolding will insert processing for new fields above this line.
81
-
82
- strong_params
83
81
  end
84
82
  end
@@ -88,7 +88,7 @@ class Account::Scaffolding::CompletelyConcrete::TangibleThingsController < Accou
88
88
  # 🚅 skip this section when scaffolding.
89
89
  multiple_button_values: [],
90
90
  multiple_option_values: [],
91
- multiple_super_select_values: [],
91
+ multiple_super_select_values: []
92
92
  # 🚅 stop any skipping we're doing now.
93
93
  # 🚅 super scaffolding will insert new arrays above this line.
94
94
  )
@@ -0,0 +1,103 @@
1
+ class Api::V1::Scaffolding::AbsolutelyAbstract::CreativeConceptsEndpoint < Api::V1::Root
2
+ helpers do
3
+ include Scaffolding::AbsolutelyAbstract::CreativeConcepts::ControllerSupport
4
+
5
+ params :team_id do
6
+ requires :team_id, type: Integer, allow_blank: false, desc: Api.heading(:team_id)
7
+ end
8
+
9
+ params :id do
10
+ requires :id, type: Integer, allow_blank: false, desc: Api.heading(:id)
11
+ end
12
+
13
+ params :creative_concept do
14
+ optional :name, type: String, allow_blank: false, desc: Api.heading(:name)
15
+ optional :description, type: String, allow_blank: true, desc: Api.heading(:description)
16
+ # 🚅 super scaffolding will insert new fields above this line.
17
+ # 🚅 super scaffolding will insert new arrays above this line.
18
+
19
+ # 🚅 super scaffolding will insert processing for new fields above this line.
20
+ end
21
+ end
22
+
23
+ # uses shallow routing to support teams
24
+ resource :teams, desc: Api.title(:collection_actions) do
25
+ after_validation do
26
+ load_and_authorize_api_resource Scaffolding::AbsolutelyAbstract::CreativeConcept
27
+ end
28
+
29
+ desc Api.title(:index), &Api.index_desc
30
+ params do
31
+ use :team_id
32
+ end
33
+ oauth2
34
+ paginate per_page: 100
35
+ get "/:team_id/scaffolding/absolutely_abstract/creative_concepts" do
36
+ @paginated_creative_concepts = paginate @creative_concepts
37
+ render @paginated_creative_concepts, serializer: Api.serializer, adapter: :attributes
38
+ end
39
+
40
+ desc Api.title(:create), &Api.create_desc
41
+ params do
42
+ use :team_id
43
+ use :creative_concept
44
+ end
45
+ route_setting :api_resource_options, permission: :create
46
+ oauth2 "write"
47
+ post "/:team_id/scaffolding/absolutely_abstract/creative_concepts" do
48
+ ensure_current_user_can_manage_creative_concept @creative_concept
49
+
50
+ if @creative_concept.save
51
+ render @creative_concept, serializer: Api.serializer
52
+ else
53
+ record_not_saved @creative_concept
54
+ end
55
+ end
56
+ end
57
+
58
+ resource "scaffolding/absolutely_abstract/creative_concepts", desc: Api.title(:member_actions) do
59
+ after_validation do
60
+ load_and_authorize_api_resource Scaffolding::AbsolutelyAbstract::CreativeConcept
61
+ end
62
+
63
+ desc Api.title(:show), &Api.show_desc
64
+ params do
65
+ use :id
66
+ end
67
+ oauth2
68
+ route_param :id do
69
+ get do
70
+ render @creative_concept, serializer: Api.serializer
71
+ end
72
+ end
73
+
74
+ desc Api.title(:update), &Api.update_desc
75
+ params do
76
+ use :id
77
+ use :creative_concept
78
+ end
79
+ route_setting :api_resource_options, permission: :update
80
+ oauth2 "write"
81
+ route_param :id do
82
+ put do
83
+ if @creative_concept.update(declared(params, include_missing: false))
84
+ render @creative_concept, serializer: Api.serializer
85
+ else
86
+ record_not_saved @creative_concept
87
+ end
88
+ end
89
+ end
90
+
91
+ desc Api.title(:destroy), &Api.destroy_desc
92
+ params do
93
+ use :id
94
+ end
95
+ route_setting :api_resource_options, permission: :destroy
96
+ oauth2 "delete"
97
+ route_param :id do
98
+ delete do
99
+ render @creative_concept.destroy, serializer: Api.serializer
100
+ end
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,136 @@
1
+ class Api::V1::Scaffolding::CompletelyConcrete::TangibleThingsEndpoint < Api::V1::Root
2
+ helpers do
3
+ params :absolutely_abstract_creative_concept_id do
4
+ requires :absolutely_abstract_creative_concept_id, type: Integer, allow_blank: false, desc: "Creative Concept ID"
5
+ end
6
+
7
+ params :id do
8
+ requires :id, type: Integer, allow_blank: false, desc: "Tangible Thing ID"
9
+ end
10
+
11
+ params :tangible_thing do
12
+ # 🚅 skip this section when scaffolding.
13
+ optional :text_field_value, type: String, allow_blank: true, desc: Api.heading(:text_field_value)
14
+ optional :button_value, type: String, allow_blank: true, desc: Api.heading(:button_value)
15
+ optional :cloudinary_image_value, type: String, allow_blank: true, desc: Api.heading(:cloudinary_image_value)
16
+ optional :date_field_value, type: Date, allow_blank: true, desc: Api.heading(:date_field_value)
17
+ optional :date_and_time_field_value, type: DateTime, allow_blank: true, desc: Api.heading(:date_and_time_field_value)
18
+ optional :email_field_value, type: String, allow_blank: true, desc: Api.heading(:email_field_value)
19
+ optional :password_field_value, type: String, allow_blank: true, desc: Api.heading(:password_field_value)
20
+ optional :phone_field_value, type: String, allow_blank: true, desc: Api.heading(:phone_field_value)
21
+ optional :option_value, type: String, allow_blank: true, desc: Api.heading(:option_value)
22
+ optional :super_select_value, type: String, allow_blank: true, desc: Api.heading(:super_select_value)
23
+ optional :text_area_value, type: String, allow_blank: true, desc: Api.heading(:text_area_value)
24
+ optional :action_text_value, type: String, allow_blank: true, desc: Api.heading(:action_text_value)
25
+ optional :ckeditor_value, type: String, allow_blank: true, desc: Api.heading(:ckeditor_value)
26
+ # 🚅 stop any skipping we're doing now.
27
+ # 🚅 super scaffolding will insert new fields above this line.
28
+ # 🚅 skip this section when scaffolding.
29
+ optional :multiple_button_values, type: Array, default: [], desc: Api.heading(:multiple_button_values)
30
+ optional :multiple_option_values, type: Array, default: [], desc: Api.heading(:multiple_option_values)
31
+ optional :multiple_super_select_values, type: Array, default: [], desc: Api.heading(:multiple_super_select_values)
32
+ # 🚅 stop any skipping we're doing now.
33
+ # 🚅 super scaffolding will insert new arrays above this line.
34
+
35
+ # 🚅 super scaffolding will insert processing for new fields above this line.
36
+ end
37
+ end
38
+
39
+ resource "scaffolding/absolutely_abstract/creative_concepts", desc: Api.title(:collection_actions) do
40
+ after_validation do
41
+ load_and_authorize_api_resource Scaffolding::CompletelyConcrete::TangibleThing
42
+ end
43
+
44
+ #
45
+ # INDEX
46
+ #
47
+
48
+ desc Api.title(:index), &Api.index_desc
49
+ params do
50
+ use :absolutely_abstract_creative_concept_id
51
+ end
52
+ oauth2
53
+ paginate per_page: 100
54
+ get "/:absolutely_abstract_creative_concept_id/completely_concrete/tangible_things" do
55
+ @paginated_tangible_things = paginate @tangible_things
56
+ render @paginated_tangible_things, serializer: Api.serializer
57
+ end
58
+
59
+ #
60
+ # CREATE
61
+ #
62
+
63
+ desc Api.title(:create), &Api.create_desc
64
+ params do
65
+ use :absolutely_abstract_creative_concept_id
66
+ use :tangible_thing
67
+ end
68
+ route_setting :api_resource_options, permission: :create
69
+ oauth2 "write"
70
+ post "/:absolutely_abstract_creative_concept_id/completely_concrete/tangible_things" do
71
+ if @tangible_thing.save
72
+ render @tangible_thing, serializer: Api.serializer
73
+ else
74
+ record_not_saved @tangible_thing
75
+ end
76
+ end
77
+ end
78
+
79
+ resource "scaffolding/completely_concrete/tangible_things", desc: Api.title(:member_actions) do
80
+ after_validation do
81
+ load_and_authorize_api_resource Scaffolding::CompletelyConcrete::TangibleThing
82
+ end
83
+
84
+ #
85
+ # SHOW
86
+ #
87
+
88
+ desc Api.title(:show), &Api.show_desc
89
+ params do
90
+ use :id
91
+ end
92
+ oauth2
93
+ route_param :id do
94
+ get do
95
+ render @tangible_thing, serializer: Api.serializer
96
+ end
97
+ end
98
+
99
+ #
100
+ # UPDATE
101
+ #
102
+
103
+ desc Api.title(:update), &Api.update_desc
104
+ params do
105
+ use :id
106
+ use :tangible_thing
107
+ end
108
+ route_setting :api_resource_options, permission: :update
109
+ oauth2 "write"
110
+ route_param :id do
111
+ put do
112
+ if @tangible_thing.update(declared(params, include_missing: false))
113
+ render @tangible_thing, serializer: Api.serializer
114
+ else
115
+ record_not_saved @tangible_thing
116
+ end
117
+ end
118
+ end
119
+
120
+ #
121
+ # DESTROY
122
+ #
123
+
124
+ desc Api.title(:destroy), &Api.destroy_desc
125
+ params do
126
+ use :id
127
+ end
128
+ route_setting :api_resource_options, permission: :destroy
129
+ oauth2 "delete"
130
+ route_param :id do
131
+ delete do
132
+ render @tangible_thing.destroy, serializer: Api.serializer
133
+ end
134
+ end
135
+ end
136
+ end
data/config/routes.rb CHANGED
@@ -1,2 +1,30 @@
1
1
  Rails.application.routes.draw do
2
+ collection_actions = [:index, :new, :create]
3
+
4
+ namespace :account do
5
+ shallow do
6
+ resources :teams do
7
+ unless scaffolding_things_disabled?
8
+ namespace :scaffolding do
9
+ namespace :absolutely_abstract do
10
+ resources :creative_concepts do
11
+ scope module: "creative_concepts" do
12
+ resources :collaborators, only: collection_actions
13
+ end
14
+
15
+ namespace :creative_concepts do
16
+ resources :collaborators, except: collection_actions
17
+ end
18
+ end
19
+ end
20
+ resources :absolutely_abstract_creative_concepts, path: "absolutely_abstract/creative_concepts" do
21
+ namespace :completely_concrete do
22
+ resources :tangible_things
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
2
30
  end
@@ -2,6 +2,10 @@ module BulletTrain
2
2
  module SuperScaffolding
3
3
  module Templates
4
4
  class Engine < ::Rails::Engine
5
+ initializer "bullet_train.super_scaffolding.templates.register_template_path" do |app|
6
+ # Register the base path of this package with the Super Scaffolding engine.
7
+ BulletTrain::SuperScaffolding.template_paths << File.expand_path('../../../../..', __FILE__)
8
+ end
5
9
  end
6
10
  end
7
11
  end
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module SuperScaffolding
3
3
  module Templates
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-super_scaffolding-templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.4
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-01-24 00:00:00.000000000 Z
11
+ date: 2022-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -38,6 +38,8 @@ files:
38
38
  - app/controllers/account/scaffolding/absolutely_abstract/creative_concepts/collaborators_controller.rb
39
39
  - app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb
40
40
  - app/controllers/account/scaffolding/completely_concrete/tangible_things_controller.rb
41
+ - app/controllers/api/v1/scaffolding/absolutely_abstract/creative_concepts_endpoint.rb
42
+ - app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_endpoint.rb
41
43
  - app/controllers/concerns/scaffolding/absolutely_abstract/creative_concepts/controller_support.rb
42
44
  - app/models/scaffolding/absolutely_abstract.rb
43
45
  - app/models/scaffolding/absolutely_abstract/creative_concept.rb