bullet_train 1.0.11 → 1.0.15

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: fe8d2496703f3d58b654d6a86b7fa9f5b0e1a29d7f6abc392c4393e0033147fc
4
- data.tar.gz: 4d2eec433d7d5b7b8c9d65adb600c338e561b905fb659925dd70d162a979cfc5
3
+ metadata.gz: 301b2a691f3affe527a614392681f2038544d45203e0bc339fc01bc253209273
4
+ data.tar.gz: c124ba84eba0dc3745bc1da337331bb58168832f670a88ba08ad1c669691fb38
5
5
  SHA512:
6
- metadata.gz: 52f166965026e286f9d8f1c36bee7dc002192eb754ab5186ad6d225de5317b124fc58865b16ac371336c2df38742c0c46deb34cf2a3321357f385284ea35fe61
7
- data.tar.gz: 5fdadbf567930300788d5a5806495cc39331bd160425e722e2ebb515af2f3880ae7b0b0471f6ccc4e19cd27c40fc7b0bfb82f847c8050c840a7ff38be2c66515
6
+ metadata.gz: b9794f6f91d92c294f1b631b8666411ae7fc37c255c42a44c5b753c2498f65a6b8fcdd5c2eb064671e4b9eaaeb5ef2fa86d67e4eab6f102292dae4471caa3183
7
+ data.tar.gz: b58aca98a77c6281e46ebd31c22d175557ca8c265a0a6d383d2810d2b06867da01015712a0e4724f507f0896331ecb201a4d785907104935d9574bfb71b64fb6
@@ -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, member_actions: [:demote, :promote, :reinvite], collection_actions: [:search]
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
- # 🚅 super scaffolding will insert new fields above this line.
108
- # 🚅 super scaffolding will insert new arrays above this line.
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(
130
+ strong_params = params.require(:team).permit(
117
131
  :name,
118
132
  :time_zone,
119
133
  :locale,
120
- # 🚅 super scaffolding will insert new fields above this line.
121
- # 🚅 super scaffolding will insert new arrays above this line.
134
+ *permitted_fields,
135
+ *permitted_arrays,
122
136
  )
123
137
 
124
- # 🚅 super scaffolding will insert processing for new fields above this line.
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
- :email,
48
- :first_name,
49
- :last_name,
50
- :time_zone,
51
- :current_password,
52
- :password,
53
- :password_confirmation,
54
- :profile_photo_id,
55
- :locale,
56
- # 🚅 super scaffolding will insert new fields above this line.
57
- current_team_attributes: [:name],
58
- # 🚅 super scaffolding will insert new arrays above this line.
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
- # 🚅 super scaffolding will insert processing for new fields above this line.
78
+ process_params(strong_params)
62
79
  end
63
80
  end
@@ -0,0 +1 @@
1
+ <%# 🚅 super scaffolding will insert new fields above this line. %>
@@ -35,6 +35,7 @@
35
35
  <% end %>
36
36
  <% end %>
37
37
 
38
+ <%= render "account/memberships/fields", membership: membership, form: form %>
38
39
  <%# 🚅 super scaffolding will insert new fields above this line. %>
39
40
 
40
41
  <div class="buttons">
@@ -0,0 +1 @@
1
+ <%# 🚅 super scaffolding will insert new fields above this line. %>
@@ -12,6 +12,7 @@
12
12
  <%= render 'shared/fields/buttons', method: :locale, options: t("locale.locales") %>
13
13
  <% end %>
14
14
 
15
+ <%= render "account/teams/fields", team: team, form: form %>
15
16
  <%# 🚅 super scaffolding will insert new fields above this line. %>
16
17
  <% end %>
17
18
 
@@ -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
 
@@ -77,7 +77,7 @@ en:
77
77
  teams: *teams
78
78
  activerecord:
79
79
  attributes:
80
- user:
80
+ team:
81
81
  name: *name
82
82
  time_zone: *time_zone
83
83
  locale: *locale
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.11"
2
+ VERSION = "1.0.15"
3
3
  end
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.11
4
+ version: 1.0.15
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-02-12 00:00:00.000000000 Z
11
+ date: 2022-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,6 +24,62 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 7.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bullet_train-roles
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.4
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.4
41
+ - !ruby/object:Gem::Dependency
42
+ name: bullet_train-super_load_and_authorize_resource
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bullet_train-has_uuid
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bullet_train-scope_validator
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
27
83
  description: Bullet Train
28
84
  email:
29
85
  - andrew.culver@gmail.com
@@ -94,6 +150,7 @@ files:
94
150
  - app/views/account/invitations/show.html.erb
95
151
  - app/views/account/invitations/show.json.jbuilder
96
152
  - app/views/account/memberships/_breadcrumbs.html.erb
153
+ - app/views/account/memberships/_fields.html.erb
97
154
  - app/views/account/memberships/_form.html.erb
98
155
  - app/views/account/memberships/_index.html.erb
99
156
  - app/views/account/memberships/_menu_item.html.erb
@@ -104,6 +161,7 @@ files:
104
161
  - app/views/account/onboarding/user_details/edit.html.erb
105
162
  - app/views/account/onboarding/user_email/edit.html.erb
106
163
  - app/views/account/teams/_breadcrumbs.html.erb
164
+ - app/views/account/teams/_fields.html.erb
107
165
  - app/views/account/teams/_form.html.erb
108
166
  - app/views/account/teams/_index.html.erb
109
167
  - app/views/account/teams/_menu_item.html.erb
@@ -117,6 +175,7 @@ files:
117
175
  - app/views/account/two_factors/create.js.erb
118
176
  - app/views/account/two_factors/destroy.js.erb
119
177
  - app/views/account/users/_breadcrumbs.html.erb
178
+ - app/views/account/users/_fields.html.erb
120
179
  - app/views/account/users/_form.html.erb
121
180
  - app/views/account/users/edit.html.erb
122
181
  - app/views/account/users/show.html.erb