bullet_train 1.0.9 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/account/invitations_controller.rb +1 -1
- data/app/controllers/account/memberships_controller.rb +19 -0
- data/app/controllers/account/teams_controller.rb +19 -0
- data/app/controllers/account/users_controller.rb +19 -0
- data/app/controllers/concerns/account/invitations/controller_base.rb +12 -2
- data/app/controllers/concerns/account/memberships/controller_base.rb +6 -4
- data/app/controllers/concerns/account/teams/controller_base.rb +20 -6
- data/app/controllers/concerns/account/users/controller_base.rb +32 -15
- data/app/views/account/memberships/_fields.html.erb +1 -0
- data/app/views/account/memberships/_form.html.erb +1 -0
- data/app/views/account/teams/_fields.html.erb +1 -0
- data/app/views/account/teams/_form.html.erb +1 -0
- data/app/views/account/users/_fields.html.erb +1 -0
- data/app/views/account/users/_form.html.erb +3 -0
- data/config/locales/en/teams.en.yml +1 -1
- data/lib/bullet_train/version.rb +1 -1
- data/lib/bullet_train.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0677829999c2d36443830135c4e9253699a24ee451f79994cb1dde3c168d791e'
|
4
|
+
data.tar.gz: 35600ff4e75a7b1b5c1f9638568c776ab2d3a5aa4fee533a1521404c8464a637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9606c7f6d10dc6c50004b42a8c2b1dd8925c05da610c9dfd93f62ca43c7142a77f335536983f48c81dcb5a48fb1a384b4957cb6038990791cb1a13b0afc885e6
|
7
|
+
data.tar.gz: ea7ac99e62db85d828082ff1c8ff0fc90b1ff885f4c8549b3e424e7a24a0378abc8bd1e0367d3cc1b605de4f47dbeca279502071d3bc1ec890826107239d48ca
|
@@ -1,3 +1,22 @@
|
|
1
1
|
class Account::MembershipsController < Account::ApplicationController
|
2
2
|
include Account::Memberships::ControllerBase
|
3
|
+
|
4
|
+
private
|
5
|
+
|
6
|
+
def permitted_fields
|
7
|
+
[
|
8
|
+
# 🚅 super scaffolding will insert new fields above this line.
|
9
|
+
]
|
10
|
+
end
|
11
|
+
|
12
|
+
def permitted_arrays
|
13
|
+
{
|
14
|
+
# 🚅 super scaffolding will insert new arrays above this line.
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
def process_params(strong_params)
|
19
|
+
# 🚅 super scaffolding will insert processing for new fields above this line.
|
20
|
+
strong_params
|
21
|
+
end
|
3
22
|
end
|
@@ -1,3 +1,22 @@
|
|
1
1
|
class Account::TeamsController < Account::ApplicationController
|
2
2
|
include Account::Teams::ControllerBase
|
3
|
+
|
4
|
+
private
|
5
|
+
|
6
|
+
def permitted_fields
|
7
|
+
[
|
8
|
+
# 🚅 super scaffolding will insert new fields above this line.
|
9
|
+
]
|
10
|
+
end
|
11
|
+
|
12
|
+
def permitted_arrays
|
13
|
+
{
|
14
|
+
# 🚅 super scaffolding will insert new arrays above this line.
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
def process_params(strong_params)
|
19
|
+
# 🚅 super scaffolding will insert processing for new fields above this line.
|
20
|
+
strong_params
|
21
|
+
end
|
3
22
|
end
|
@@ -1,3 +1,22 @@
|
|
1
1
|
class Account::UsersController < Account::ApplicationController
|
2
2
|
include Account::Users::ControllerBase
|
3
|
+
|
4
|
+
private
|
5
|
+
|
6
|
+
def permitted_fields
|
7
|
+
[
|
8
|
+
# 🚅 super scaffolding will insert new fields above this line.
|
9
|
+
]
|
10
|
+
end
|
11
|
+
|
12
|
+
def permitted_arrays
|
13
|
+
{
|
14
|
+
# 🚅 super scaffolding will insert new arrays above this line.
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
def process_params(strong_params)
|
19
|
+
# 🚅 super scaffolding will insert processing for new fields above this line.
|
20
|
+
strong_params
|
21
|
+
end
|
3
22
|
end
|
@@ -112,6 +112,18 @@ module Account::Invitations::ControllerBase
|
|
112
112
|
|
113
113
|
private
|
114
114
|
|
115
|
+
def permitted_fields
|
116
|
+
raise "It looks like you've removed `permitted_fields` from your controller. This will break Super Scaffolding."
|
117
|
+
end
|
118
|
+
|
119
|
+
def permitted_arrays
|
120
|
+
raise "It looks like you've removed `permitted_arrays` from your controller. This will break Super Scaffolding."
|
121
|
+
end
|
122
|
+
|
123
|
+
def process_params(strong_params)
|
124
|
+
raise "It looks like you've removed `process_params` from your controller. This will break Super Scaffolding."
|
125
|
+
end
|
126
|
+
|
115
127
|
def manageable_role_keys
|
116
128
|
helpers.current_membership.manageable_roles.map(&:key)
|
117
129
|
end
|
@@ -143,8 +155,6 @@ module Account::Invitations::ControllerBase
|
|
143
155
|
|
144
156
|
end
|
145
157
|
|
146
|
-
# 🚅 super scaffolding will insert processing for new fields above this line.
|
147
|
-
|
148
158
|
strong_params
|
149
159
|
end
|
150
160
|
end
|
@@ -2,7 +2,9 @@ module Account::Memberships::ControllerBase
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
included do
|
5
|
-
account_load_and_authorize_resource :membership, :team,
|
5
|
+
account_load_and_authorize_resource :membership, :team,
|
6
|
+
member_actions: [:demote, :promote, :reinvite] + (defined?(MEMBER_ACTIONS) ? MEMBER_ACTIONS : []),
|
7
|
+
collection_actions: [:search] + (defined?(COLLECTION_ACTIONS) ? COLLECTION_ACTIONS : [])
|
6
8
|
end
|
7
9
|
|
8
10
|
def index
|
@@ -104,8 +106,8 @@ module Account::Memberships::ControllerBase
|
|
104
106
|
:user_first_name,
|
105
107
|
:user_last_name,
|
106
108
|
:user_profile_photo_id,
|
107
|
-
|
108
|
-
|
109
|
+
*permitted_fields,
|
110
|
+
*permitted_arrays,
|
109
111
|
)
|
110
112
|
|
111
113
|
# after that, we have to be more careful how we update the roles.
|
@@ -131,6 +133,6 @@ module Account::Memberships::ControllerBase
|
|
131
133
|
|
132
134
|
# 🚅 super scaffolding will insert processing for new fields above this line.
|
133
135
|
|
134
|
-
strong_params
|
136
|
+
process_params(strong_params)
|
135
137
|
end
|
136
138
|
end
|
@@ -2,7 +2,9 @@ module Account::Teams::ControllerBase
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
included do
|
5
|
-
load_and_authorize_resource :team, class: "Team", prepend: true
|
5
|
+
load_and_authorize_resource :team, class: "Team", prepend: true,
|
6
|
+
member_actions: (defined?(MEMBER_ACTIONS) ? MEMBER_ACTIONS : []),
|
7
|
+
collection_actions: (defined?(COLLECTION_ACTIONS) ? COLLECTION_ACTIONS : [])
|
6
8
|
|
7
9
|
prepend_before_action do
|
8
10
|
if params["action"] == "new"
|
@@ -111,16 +113,28 @@ module Account::Teams::ControllerBase
|
|
111
113
|
|
112
114
|
private
|
113
115
|
|
116
|
+
def permitted_fields
|
117
|
+
raise "It looks like you've removed `permitted_fields` from your controller. This will break Super Scaffolding."
|
118
|
+
end
|
119
|
+
|
120
|
+
def permitted_arrays
|
121
|
+
raise "It looks like you've removed `permitted_arrays` from your controller. This will break Super Scaffolding."
|
122
|
+
end
|
123
|
+
|
124
|
+
def process_params(strong_params)
|
125
|
+
raise "It looks like you've removed `process_params` from your controller. This will break Super Scaffolding."
|
126
|
+
end
|
127
|
+
|
114
128
|
# Never trust parameters from the scary internet, only allow the white list through.
|
115
129
|
def team_params
|
116
|
-
params.require(:team).permit(
|
117
|
-
:name,
|
130
|
+
strong_params = params.require(:team).permit(
|
131
|
+
# :name,
|
118
132
|
:time_zone,
|
119
133
|
:locale,
|
120
|
-
|
121
|
-
|
134
|
+
*permitted_fields,
|
135
|
+
*permitted_arrays,
|
122
136
|
)
|
123
137
|
|
124
|
-
|
138
|
+
process_params(strong_params)
|
125
139
|
end
|
126
140
|
end
|
@@ -2,7 +2,9 @@ module Account::Users::ControllerBase
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
included do
|
5
|
-
load_and_authorize_resource
|
5
|
+
load_and_authorize_resource :user, class: "User", prepend: true,
|
6
|
+
member_actions: (defined?(MEMBER_ACTIONS) ? MEMBER_ACTIONS : []),
|
7
|
+
collection_actions: (defined?(COLLECTION_ACTIONS) ? COLLECTION_ACTIONS : [])
|
6
8
|
|
7
9
|
before_action do
|
8
10
|
# for magic locales.
|
@@ -40,24 +42,39 @@ module Account::Users::ControllerBase
|
|
40
42
|
|
41
43
|
private
|
42
44
|
|
45
|
+
def permitted_fields
|
46
|
+
raise "It looks like you've removed `permitted_fields` from your controller. This will break Super Scaffolding."
|
47
|
+
end
|
48
|
+
|
49
|
+
def permitted_arrays
|
50
|
+
raise "It looks like you've removed `permitted_arrays` from your controller. This will break Super Scaffolding."
|
51
|
+
end
|
52
|
+
|
53
|
+
def process_params(strong_params)
|
54
|
+
raise "It looks like you've removed `process_params` from your controller. This will break Super Scaffolding."
|
55
|
+
end
|
56
|
+
|
43
57
|
# Never trust parameters from the scary internet, only allow the white list through.
|
44
58
|
def user_params
|
45
59
|
# TODO enforce permissions on updating the user's team name.
|
46
|
-
params.require(:user).permit(
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
60
|
+
strong_params = params.require(:user).permit(
|
61
|
+
*([
|
62
|
+
:email,
|
63
|
+
:first_name,
|
64
|
+
:last_name,
|
65
|
+
:time_zone,
|
66
|
+
:current_password,
|
67
|
+
:password,
|
68
|
+
:password_confirmation,
|
69
|
+
:profile_photo_id,
|
70
|
+
:locale,
|
71
|
+
] + permitted_fields + [
|
72
|
+
{
|
73
|
+
current_team_attributes: [:name]
|
74
|
+
}.merge(permitted_arrays)
|
75
|
+
])
|
59
76
|
)
|
60
77
|
|
61
|
-
|
78
|
+
process_params(strong_params)
|
62
79
|
end
|
63
80
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
@@ -30,6 +30,9 @@
|
|
30
30
|
<%= render 'shared/fields/buttons', method: :locale, options: {"": t("locale.default")}.merge(t("locale.locales")) %>
|
31
31
|
</div>
|
32
32
|
<% end %>
|
33
|
+
|
34
|
+
<%= render "account/users/fields", user: user, form: form %>
|
35
|
+
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
33
36
|
</div>
|
34
37
|
<% end %>
|
35
38
|
|
data/lib/bullet_train/version.rb
CHANGED
data/lib/bullet_train.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.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: 2022-
|
11
|
+
date: 2022-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- app/views/account/invitations/show.html.erb
|
95
95
|
- app/views/account/invitations/show.json.jbuilder
|
96
96
|
- app/views/account/memberships/_breadcrumbs.html.erb
|
97
|
+
- app/views/account/memberships/_fields.html.erb
|
97
98
|
- app/views/account/memberships/_form.html.erb
|
98
99
|
- app/views/account/memberships/_index.html.erb
|
99
100
|
- app/views/account/memberships/_menu_item.html.erb
|
@@ -104,6 +105,7 @@ files:
|
|
104
105
|
- app/views/account/onboarding/user_details/edit.html.erb
|
105
106
|
- app/views/account/onboarding/user_email/edit.html.erb
|
106
107
|
- app/views/account/teams/_breadcrumbs.html.erb
|
108
|
+
- app/views/account/teams/_fields.html.erb
|
107
109
|
- app/views/account/teams/_form.html.erb
|
108
110
|
- app/views/account/teams/_index.html.erb
|
109
111
|
- app/views/account/teams/_menu_item.html.erb
|
@@ -117,6 +119,7 @@ files:
|
|
117
119
|
- app/views/account/two_factors/create.js.erb
|
118
120
|
- app/views/account/two_factors/destroy.js.erb
|
119
121
|
- app/views/account/users/_breadcrumbs.html.erb
|
122
|
+
- app/views/account/users/_fields.html.erb
|
120
123
|
- app/views/account/users/_form.html.erb
|
121
124
|
- app/views/account/users/edit.html.erb
|
122
125
|
- app/views/account/users/show.html.erb
|