bullet_train 1.0.10 → 1.0.14

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: a460b28ddcaa9b63e0b3d86ff22bd1f55947bb98e76abe6febde2be804253732
4
- data.tar.gz: efe38f3559f947a23bbb33a87bf199e692c4595d886b01911c2756945576a750
3
+ metadata.gz: ab87fd21ed20d2e44b0ea8da3f36ee3d02b019c117470e4de75b0ed3cbd1e3d9
4
+ data.tar.gz: adb6be101416161e62e724fc13549e18cec30495a3d1ed891cdb1c19efb5dc6a
5
5
  SHA512:
6
- metadata.gz: c46781c9c2a4f4fc3c6e31326610fa87839c73d0f96b802c344a2048683f73c7842720fcd2d059b7adb11630767490d9bbc6fadda839a624fe80a6ff28766db8
7
- data.tar.gz: cead3f1bc71f9d70ea51fa211252770370f07526dbc9879073f1326fd9fe2fd9b52ebbd6f9a8922b998b848b2da2add9bc9ad991928c088348bd33a1e8fc35e7
6
+ metadata.gz: 8d722d0f9d86bf584ef468d22e3b08d60a2560b3da9a2a32c42ad735c5d0837a14e95af799b1be2149bbebb98c0b32b6e3ae2d85e3318e4029bc637cf79edbc9
7
+ data.tar.gz: '03906babe50d9532090a459f518cb607a279024ba09f6ad525efd3bd69a2f59ad3fb3156472aff82c16032095014c87786200fc7bc88f793b4a6b4a1cb0e496a'
@@ -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.10"
2
+ VERSION = "1.0.14"
3
3
  end
data/lib/bullet_train.rb CHANGED
@@ -2,5 +2,5 @@ require "bullet_train/version"
2
2
  require "bullet_train/engine"
3
3
 
4
4
  module BulletTrain
5
- # Your code goes here...
5
+ mattr_accessor :routing_concerns, default: []
6
6
  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.10
4
+ version: 1.0.14
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-11 00:00:00.000000000 Z
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