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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e043af38dcb40348528dd6b925433147b3e58f0fd64d969c7396feebce04091a
4
- data.tar.gz: 4546e61efd71d6b92c270e02a50ff33e558d6007d4cc761c925192d77562459f
3
+ metadata.gz: '0677829999c2d36443830135c4e9253699a24ee451f79994cb1dde3c168d791e'
4
+ data.tar.gz: 35600ff4e75a7b1b5c1f9638568c776ab2d3a5aa4fee533a1521404c8464a637
5
5
  SHA512:
6
- metadata.gz: 4f448f5cacf14583c92761252adff72ee3c7b8474b291e1ccb3f4b7874acf341a329fc5ee96be8d948d7394739abd5508fa78a813b0d922daae5b82d791eafa0
7
- data.tar.gz: b0865e4751fd3819475fea1bab30e30e503f21ad75d884e69db241af605a6178519ea3bb6b4c617a84b75c8f2888eb94ba377ee762c6218a1a21830617323c5e
6
+ metadata.gz: 9606c7f6d10dc6c50004b42a8c2b1dd8925c05da610c9dfd93f62ca43c7142a77f335536983f48c81dcb5a48fb1a384b4957cb6038990791cb1a13b0afc885e6
7
+ data.tar.gz: ea7ac99e62db85d828082ff1c8ff0fc90b1ff885f4c8549b3e424e7a24a0378abc8bd1e0367d3cc1b605de4f47dbeca279502071d3bc1ec890826107239d48ca
@@ -1,3 +1,3 @@
1
1
  class Account::InvitationsController < Account::ApplicationController
2
- include Invitations::ControllerBase
2
+ include Account::Invitations::ControllerBase
3
3
  end
@@ -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(
117
- :name,
130
+ strong_params = params.require(:team).permit(
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.9"
2
+ VERSION = "1.0.13"
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.9
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-01-31 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