organizations 0.4.2 → 0.5.0

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -9
  3. data/.rubocop_todo.yml +625 -0
  4. data/CHANGELOG.md +53 -0
  5. data/README.md +414 -46
  6. data/app/controllers/organizations/application_controller.rb +4 -0
  7. data/app/controllers/organizations/memberships_controller.rb +3 -3
  8. data/app/controllers/organizations/public_controller.rb +26 -0
  9. data/app/mailers/organizations/invitation_mailer.rb +38 -18
  10. data/app/mailers/organizations/verification_mailer.rb +56 -0
  11. data/app/models/organizations/allowlist_entry.rb +6 -0
  12. data/app/models/organizations/domain.rb +6 -0
  13. data/app/models/organizations/join_code.rb +6 -0
  14. data/app/models/organizations/join_request.rb +6 -0
  15. data/app/views/organizations/invitation_mailer/invitation_email.html.erb +16 -13
  16. data/app/views/organizations/invitation_mailer/invitation_email.text.erb +8 -8
  17. data/app/views/organizations/verification_mailer/code_email.html.erb +22 -0
  18. data/app/views/organizations/verification_mailer/code_email.text.erb +7 -0
  19. data/config/locales/en.yml +158 -0
  20. data/config/locales/es.yml +126 -0
  21. data/config/routes.rb +46 -28
  22. data/gemfiles/rails_7.2.gemfile +3 -3
  23. data/gemfiles/rails_8.1.gemfile +3 -3
  24. data/lib/generators/organizations/install/install_generator.rb +3 -0
  25. data/lib/generators/organizations/install/templates/create_organizations_tables.rb.erb +170 -25
  26. data/lib/generators/organizations/install/templates/initializer.rb +53 -0
  27. data/lib/generators/organizations/upgrade/templates/add_verified_joining_to_organizations.rb.erb +180 -0
  28. data/lib/generators/organizations/upgrade/upgrade_generator.rb +50 -0
  29. data/lib/generators/organizations/views/templates/organizations/invitations/_form.html.erb +51 -0
  30. data/lib/generators/organizations/views/templates/organizations/invitations/index.html.erb +112 -0
  31. data/lib/generators/organizations/views/templates/organizations/invitations/new.html.erb +10 -0
  32. data/lib/generators/organizations/views/templates/organizations/invitations/show.html.erb +99 -0
  33. data/lib/generators/organizations/views/templates/organizations/memberships/index.html.erb +87 -0
  34. data/lib/generators/organizations/views/templates/organizations/organizations/_form.html.erb +39 -0
  35. data/lib/generators/organizations/views/templates/organizations/organizations/edit.html.erb +10 -0
  36. data/lib/generators/organizations/views/templates/organizations/organizations/index.html.erb +93 -0
  37. data/lib/generators/organizations/views/templates/organizations/organizations/new.html.erb +10 -0
  38. data/lib/generators/organizations/views/templates/organizations/organizations/show.html.erb +270 -0
  39. data/lib/generators/organizations/views/views_generator.rb +47 -0
  40. data/lib/organizations/callback_context.rb +9 -0
  41. data/lib/organizations/callbacks.rb +26 -18
  42. data/lib/organizations/configuration.rb +275 -1
  43. data/lib/organizations/controller_helpers.rb +38 -12
  44. data/lib/organizations/email_normalizer.rb +65 -0
  45. data/lib/organizations/join_flow.rb +227 -0
  46. data/lib/organizations/join_state.rb +117 -0
  47. data/lib/organizations/metadata_flags.rb +79 -0
  48. data/lib/organizations/models/allowlist_entry.rb +88 -0
  49. data/lib/organizations/models/concerns/has_organizations.rb +100 -12
  50. data/lib/organizations/models/domain.rb +85 -0
  51. data/lib/organizations/models/invitation.rb +105 -17
  52. data/lib/organizations/models/join_code.rb +242 -0
  53. data/lib/organizations/models/join_request.rb +627 -0
  54. data/lib/organizations/models/membership.rb +39 -8
  55. data/lib/organizations/models/organization.rb +317 -19
  56. data/lib/organizations/organization_scoped.rb +135 -0
  57. data/lib/organizations/test_helpers.rb +35 -1
  58. data/lib/organizations/version.rb +1 -1
  59. data/lib/organizations/view_helpers.rb +27 -19
  60. data/lib/organizations.rb +165 -0
  61. metadata +34 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 916bef6e3c027111a6da0cfa08cf015f2d872de614d55ab8978ce41e2a8ab8aa
4
- data.tar.gz: 6d0fb70f4292c7a7635d16acde00f7b88cdbc9fdcc8d4268d76b65010bf16667
3
+ metadata.gz: 0ffa0f2d13cc9a1eb2ca3c25bc1333f9ea27d2d1967d95b5acbd5bd5a57cd9b9
4
+ data.tar.gz: fd625579a6db02a11c5784eaef031a1789334cf01e3cf69cbb53d9dfbe0a2894
5
5
  SHA512:
6
- metadata.gz: 78deb6016d5e62f432c1949ee9b8f700ce370e75a682451ace35a6923eb208e8f83800312cb525631fc1ee150a832f2748a67ab05b7f714873ca4b09b4e67adc
7
- data.tar.gz: 529a7721cf5eef70b856a6b6e357e6d8881caf5b9108f31651cc2be7d83ea4258bde159b9a39d787ea78d71ed2b80d61939e1e5576c575df9416719729582c2f
6
+ metadata.gz: 167e836ce9aa5af1a2c99707170605be25bbaaf9923d88a8fbe13c4b2a2cc69af40febdde5c9debef799592f1a1d42040fcb1c0ec2d96ebe8a0f6c47e7c854e8
7
+ data.tar.gz: 76cd432b695b887649d9ed9cf9425e62b51b7c9a2d09f69374534afd27bf72db77f4b442e1a064130674513c23ef06467a965dd3e29bcfccca303a69dbb5bafa
data/.rubocop.yml CHANGED
@@ -1,6 +1,8 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
1
3
  # frozen_string_literal: true
2
4
 
3
- require:
5
+ plugins:
4
6
  - rubocop-minitest
5
7
  - rubocop-performance
6
8
 
@@ -42,7 +44,7 @@ Style/FrozenStringLiteralComment:
42
44
  EnforcedStyle: always
43
45
 
44
46
  Style/ClassAndModuleChildren:
45
- EnforcedStyle: compact
47
+ EnforcedStyle: nested # matches the actual codebase (module Organizations \n class X)
46
48
 
47
49
  Style/GuardClause:
48
50
  MinBodyLength: 3
@@ -61,14 +63,15 @@ Metrics/MethodLength:
61
63
 
62
64
  Metrics/BlockLength:
63
65
  Max: 25
66
+ Exclude:
67
+ - '*.gemspec' # gemspec DSL blocks are conventionally long
68
+ - 'test/**/*' # Allow long test blocks
64
69
  AllowedMethods:
65
70
  - 'configure'
66
71
  - 'describe'
67
72
  - 'context'
68
73
  - 'it'
69
74
  - 'test'
70
- Exclude:
71
- - 'test/**/*' # Allow long test blocks
72
75
 
73
76
  Metrics/AbcSize:
74
77
  Max: 20
@@ -82,7 +85,7 @@ Metrics/PerceivedComplexity:
82
85
  Max: 10
83
86
 
84
87
  # Naming
85
- Naming/PredicateName:
88
+ Naming/PredicatePrefix:
86
89
  ForbiddenPrefixes:
87
90
  - 'is_'
88
91
  AllowedMethods:
@@ -102,10 +105,6 @@ Minitest/MultipleAssertions:
102
105
  Minitest/AssertTruthy:
103
106
  Enabled: false # Allow assert instead of assert_equal true
104
107
 
105
- # Rails-specific (even though we don't have full Rails)
106
- Style/Rails/HttpStatus:
107
- Enabled: false
108
-
109
108
  # Custom overrides for this gem
110
109
  Style/AccessorGrouping:
111
110
  Enabled: false # Allow separate attr_reader/attr_writer
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,625 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config --no-exclude-limit`
3
+ # on 2026-07-16 02:20:44 UTC using RuboCop version 1.88.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 6
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
12
+ Bundler/OrderedGems:
13
+ Exclude:
14
+ - 'Gemfile'
15
+ - 'gemfiles/rails_7.2.gemfile'
16
+ - 'gemfiles/rails_8.1.gemfile'
17
+
18
+ # Offense count: 1
19
+ # This cop supports safe autocorrection (--autocorrect).
20
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
21
+ Gemspec/OrderedDependencies:
22
+ Exclude:
23
+ - 'organizations.gemspec'
24
+
25
+ # Offense count: 31
26
+ # This cop supports safe autocorrection (--autocorrect).
27
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
28
+ # SupportedStyles: with_first_argument, with_fixed_indentation
29
+ Layout/ArgumentAlignment:
30
+ Exclude:
31
+ - 'test/models/invitation_test.rb'
32
+ - 'test/regression/bugfix_regression_test.rb'
33
+ - 'test/roles_test.rb'
34
+
35
+ # Offense count: 2
36
+ # This cop supports safe autocorrection (--autocorrect).
37
+ Layout/EmptyLineAfterGuardClause:
38
+ Exclude:
39
+ - 'lib/organizations/controller_helpers.rb'
40
+
41
+ # Offense count: 1
42
+ # This cop supports safe autocorrection (--autocorrect).
43
+ Layout/EmptyLinesAfterModuleInclusion:
44
+ Exclude:
45
+ - 'test/test_helper.rb'
46
+
47
+ # Offense count: 1
48
+ # This cop supports safe autocorrection (--autocorrect).
49
+ # Configuration parameters: EnforcedStyle.
50
+ # SupportedStyles: around, only_before
51
+ Layout/EmptyLinesAroundAccessModifier:
52
+ Exclude:
53
+ - 'lib/organizations/view_helpers.rb'
54
+
55
+ # Offense count: 13
56
+ # This cop supports safe autocorrection (--autocorrect).
57
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
58
+ # SupportedStyles: aligned, indented, indented_relative_to_receiver
59
+ Layout/MultilineMethodCallIndentation:
60
+ Exclude:
61
+ - 'app/controllers/organizations/organizations_controller.rb'
62
+ - 'lib/organizations/models/invitation.rb'
63
+ - 'lib/organizations/view_helpers.rb'
64
+ - 'test/regression/security_regression_test.rb'
65
+
66
+ # Offense count: 1
67
+ # This cop supports safe autocorrection (--autocorrect).
68
+ # Configuration parameters: AllowedMethods, AllowedPatterns.
69
+ Lint/AmbiguousBlockAssociation:
70
+ Exclude:
71
+ - 'test/models/organization_test.rb'
72
+
73
+ # Offense count: 1
74
+ # This cop supports safe autocorrection (--autocorrect).
75
+ Lint/AmbiguousOperatorPrecedence:
76
+ Exclude:
77
+ - '.simplecov'
78
+
79
+ # Offense count: 2
80
+ # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
81
+ Lint/DuplicateBranch:
82
+ Exclude:
83
+ - 'lib/organizations/callbacks.rb'
84
+ - 'lib/organizations/view_helpers.rb'
85
+
86
+ # Offense count: 13
87
+ # Configuration parameters: AllowComments, AllowEmptyLambdas.
88
+ Lint/EmptyBlock:
89
+ Exclude:
90
+ - 'test/callbacks_test.rb'
91
+ - 'test/roles_test.rb'
92
+
93
+ # Offense count: 1
94
+ # This cop supports unsafe autocorrection (--autocorrect-all).
95
+ # Configuration parameters: AllowedMethods, InferNonNilReceiver, AdditionalNilMethods.
96
+ # AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
97
+ # AdditionalNilMethods: present?, blank?, try, try!
98
+ Lint/RedundantSafeNavigation:
99
+ Exclude:
100
+ - 'lib/organizations/view_helpers.rb'
101
+
102
+ # Offense count: 1
103
+ Lint/ShadowedException:
104
+ Exclude:
105
+ - 'lib/organizations/current_user_resolution.rb'
106
+
107
+ # Offense count: 1
108
+ # Configuration parameters: AllowKeywordBlockArguments.
109
+ Lint/UnderscorePrefixedVariableName:
110
+ Exclude:
111
+ - 'test/models/organization_test.rb'
112
+
113
+ # Offense count: 15
114
+ # This cop supports safe autocorrection (--autocorrect).
115
+ # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
116
+ Lint/UnusedBlockArgument:
117
+ Exclude:
118
+ - 'test/callbacks_test.rb'
119
+ - 'test/concerns/has_organizations_test.rb'
120
+ - 'test/controller_helpers_test.rb'
121
+ - 'test/data_integrity_test.rb'
122
+
123
+ # Offense count: 17
124
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
125
+ Metrics/AbcSize:
126
+ Exclude:
127
+ - 'app/controllers/organizations/invitations_controller.rb'
128
+ - 'app/controllers/organizations/memberships_controller.rb'
129
+ - 'app/controllers/organizations/organizations_controller.rb'
130
+ - 'app/controllers/organizations/switch_controller.rb'
131
+ - 'lib/organizations/configuration.rb'
132
+ - 'lib/organizations/controller_helpers.rb'
133
+ - 'lib/organizations/current_user_resolution.rb'
134
+ - 'lib/organizations/models/concerns/has_organizations.rb'
135
+ - 'lib/organizations/models/invitation.rb'
136
+ - 'lib/organizations/models/organization.rb'
137
+ - 'lib/organizations/view_helpers.rb'
138
+
139
+ # Offense count: 1
140
+ # Configuration parameters: CountBlocks, CountModifierForms, Max.
141
+ Metrics/BlockNesting:
142
+ Exclude:
143
+ - 'lib/organizations/current_user_resolution.rb'
144
+
145
+ # Offense count: 15
146
+ # Configuration parameters: CountComments, Max, CountAsOne.
147
+ Metrics/ClassLength:
148
+ Exclude:
149
+ - 'lib/organizations/configuration.rb'
150
+ - 'lib/organizations/models/invitation.rb'
151
+ - 'lib/organizations/models/organization.rb'
152
+ - 'test/callbacks_test.rb'
153
+ - 'test/concerns/has_organizations_test.rb'
154
+ - 'test/configuration_test.rb'
155
+ - 'test/controller_helpers_test.rb'
156
+ - 'test/data_integrity_test.rb'
157
+ - 'test/models/invitation_test.rb'
158
+ - 'test/models/membership_test.rb'
159
+ - 'test/models/organization_test.rb'
160
+ - 'test/regression/bugfix_regression_test.rb'
161
+ - 'test/regression/security_regression_test.rb'
162
+ - 'test/roles_test.rb'
163
+ - 'test/view_helpers_test.rb'
164
+
165
+ # Offense count: 8
166
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
167
+ Metrics/CyclomaticComplexity:
168
+ Exclude:
169
+ - 'app/mailers/organizations/invitation_mailer.rb'
170
+ - 'lib/organizations/controller_helpers.rb'
171
+ - 'lib/organizations/current_user_resolution.rb'
172
+ - 'lib/organizations/models/concerns/has_organizations.rb'
173
+ - 'lib/organizations/models/invitation.rb'
174
+ - 'lib/organizations/models/organization.rb'
175
+
176
+ # Offense count: 8
177
+ # Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
178
+ Metrics/MethodLength:
179
+ Exclude:
180
+ - 'app/controllers/organizations/memberships_controller.rb'
181
+ - 'lib/organizations/configuration.rb'
182
+ - 'lib/organizations/controller_helpers.rb'
183
+ - 'lib/organizations/current_user_resolution.rb'
184
+ - 'lib/organizations/models/invitation.rb'
185
+ - 'lib/organizations/models/organization.rb'
186
+ - 'lib/organizations/view_helpers.rb'
187
+
188
+ # Offense count: 3
189
+ # Configuration parameters: CountComments, Max, CountAsOne.
190
+ Metrics/ModuleLength:
191
+ Exclude:
192
+ - 'lib/organizations/controller_helpers.rb'
193
+ - 'lib/organizations/models/concerns/has_organizations.rb'
194
+ - 'lib/organizations/view_helpers.rb'
195
+
196
+ # Offense count: 2
197
+ # Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters.
198
+ Metrics/ParameterLists:
199
+ Exclude:
200
+ - 'lib/organizations/controller_helpers.rb'
201
+ - 'test/models/invitation_test.rb'
202
+
203
+ # Offense count: 6
204
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
205
+ Metrics/PerceivedComplexity:
206
+ Exclude:
207
+ - 'app/mailers/organizations/invitation_mailer.rb'
208
+ - 'lib/organizations/controller_helpers.rb'
209
+ - 'lib/organizations/current_user_resolution.rb'
210
+ - 'lib/organizations/models/concerns/has_organizations.rb'
211
+ - 'lib/organizations/models/invitation.rb'
212
+
213
+ # Offense count: 2
214
+ # This cop supports safe autocorrection (--autocorrect).
215
+ Minitest/AssertIncludes:
216
+ Exclude:
217
+ - 'test/regression/bugfix_regression_test.rb'
218
+ - 'test/regression/security_regression_test.rb'
219
+
220
+ # Offense count: 1
221
+ # This cop supports safe autocorrection (--autocorrect).
222
+ Minitest/AssertKindOf:
223
+ Exclude:
224
+ - 'test/models/organization_test.rb'
225
+
226
+ # Offense count: 10
227
+ # This cop supports safe autocorrection (--autocorrect).
228
+ Minitest/AssertOperator:
229
+ Exclude:
230
+ - 'test/controller_helpers_test.rb'
231
+ - 'test/data_integrity_test.rb'
232
+ - 'test/models/invitation_test.rb'
233
+ - 'test/models/membership_test.rb'
234
+ - 'test/models/organization_test.rb'
235
+
236
+ # Offense count: 134
237
+ # This cop supports safe autocorrection (--autocorrect).
238
+ Minitest/AssertPredicate:
239
+ Exclude:
240
+ - 'test/concerns/has_organizations_test.rb'
241
+ - 'test/controller_helpers_test.rb'
242
+ - 'test/data_integrity_test.rb'
243
+ - 'test/invitation_acceptance_failure_test.rb'
244
+ - 'test/invitation_acceptance_result_test.rb'
245
+ - 'test/models/invitation_test.rb'
246
+ - 'test/models/membership_test.rb'
247
+ - 'test/models/organization_test.rb'
248
+ - 'test/regression/bugfix_regression_test.rb'
249
+ - 'test/regression/security_regression_test.rb'
250
+ - 'test/roles_test.rb'
251
+
252
+ # Offense count: 269
253
+ # This cop supports safe autocorrection (--autocorrect).
254
+ Minitest/EmptyLineBeforeAssertionMethods:
255
+ Exclude:
256
+ - 'test/callbacks_test.rb'
257
+ - 'test/concerns/has_organizations_test.rb'
258
+ - 'test/configuration_test.rb'
259
+ - 'test/controller_helpers_test.rb'
260
+ - 'test/data_integrity_test.rb'
261
+ - 'test/models/invitation_test.rb'
262
+ - 'test/models/membership_test.rb'
263
+ - 'test/models/organization_test.rb'
264
+ - 'test/regression/bugfix_regression_test.rb'
265
+ - 'test/regression/security_regression_test.rb'
266
+ - 'test/roles_test.rb'
267
+ - 'test/view_helpers_test.rb'
268
+
269
+ # Offense count: 1
270
+ # This cop supports safe autocorrection (--autocorrect).
271
+ Minitest/RefuteEmpty:
272
+ Exclude:
273
+ - 'test/regression/bugfix_regression_test.rb'
274
+
275
+ # Offense count: 10
276
+ # This cop supports unsafe autocorrection (--autocorrect-all).
277
+ Minitest/RefuteFalse:
278
+ Exclude:
279
+ - 'test/configuration_test.rb'
280
+ - 'test/controller_helpers_test.rb'
281
+ - 'test/regression/bugfix_regression_test.rb'
282
+
283
+ # Offense count: 46
284
+ # This cop supports safe autocorrection (--autocorrect).
285
+ Minitest/RefutePredicate:
286
+ Exclude:
287
+ - 'test/concerns/has_organizations_test.rb'
288
+ - 'test/controller_helpers_test.rb'
289
+ - 'test/invitation_acceptance_failure_test.rb'
290
+ - 'test/invitation_acceptance_result_test.rb'
291
+ - 'test/models/invitation_test.rb'
292
+ - 'test/regression/bugfix_regression_test.rb'
293
+ - 'test/regression/security_regression_test.rb'
294
+
295
+ # Offense count: 2
296
+ Naming/AccessorMethodName:
297
+ Exclude:
298
+ - 'lib/organizations/test_helpers.rb'
299
+ - 'test/controller_helpers_test.rb'
300
+
301
+ # Offense count: 6
302
+ # This cop supports safe autocorrection (--autocorrect).
303
+ # Configuration parameters: EnforcedStyle, BlockForwardingName.
304
+ # SupportedStyles: anonymous, explicit
305
+ Naming/BlockForwarding:
306
+ Exclude:
307
+ - 'lib/organizations/models/concerns/has_organizations.rb'
308
+ - 'lib/organizations/view_helpers.rb'
309
+
310
+ # Offense count: 5
311
+ # This cop supports unsafe autocorrection (--autocorrect-all).
312
+ # Configuration parameters: EnforcedStyleForLeadingUnderscores.
313
+ # SupportedStylesForLeadingUnderscores: disallowed, required, optional
314
+ Naming/MemoizedInstanceVariableName:
315
+ Exclude:
316
+ - 'lib/organizations/controller_helpers.rb'
317
+ - 'lib/organizations/models/concerns/has_organizations.rb'
318
+ - 'lib/organizations/view_helpers.rb'
319
+
320
+ # Offense count: 2
321
+ # Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
322
+ # AllowedMethods: call
323
+ # WaywardPredicates: infinite?, nonzero?
324
+ Naming/PredicateMethod:
325
+ Exclude:
326
+ - 'lib/organizations/configuration.rb'
327
+ - 'lib/organizations/controller_helpers.rb'
328
+
329
+ # Offense count: 11
330
+ # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
331
+ # NamePrefix: is_, has_, have_, does_
332
+ # ForbiddenPrefixes: is_, has_, have_, does_
333
+ # AllowedMethods: is_a?
334
+ # MethodDefinitionMacros: define_method, define_singleton_method
335
+ Naming/PredicatePrefix:
336
+ Exclude:
337
+ - 'spec/**/*'
338
+ - 'lib/organizations/models/concerns/has_organizations.rb'
339
+ - 'lib/organizations/models/membership.rb'
340
+
341
+ # Offense count: 1
342
+ # This cop supports safe autocorrection (--autocorrect).
343
+ # Configuration parameters: IncludeActiveSupportAliases.
344
+ Performance/DoubleStartEndWith:
345
+ Exclude:
346
+ - 'lib/organizations/view_helpers.rb'
347
+
348
+ # Offense count: 1
349
+ # This cop supports unsafe autocorrection (--autocorrect-all).
350
+ # Configuration parameters: AllowRegexpMatch.
351
+ Performance/RedundantEqualityComparisonBlock:
352
+ Exclude:
353
+ - 'test/models/organization_test.rb'
354
+
355
+ # Offense count: 1
356
+ # This cop supports unsafe autocorrection (--autocorrect-all).
357
+ Performance/TimesMap:
358
+ Exclude:
359
+ - 'test/regression/bugfix_regression_test.rb'
360
+
361
+ # Offense count: 3
362
+ # This cop supports safe autocorrection (--autocorrect).
363
+ # Configuration parameters: EnforcedStyle.
364
+ # SupportedStyles: prefer_alias, prefer_alias_method
365
+ Style/Alias:
366
+ Exclude:
367
+ - 'app/controllers/organizations/application_controller.rb'
368
+ - 'lib/organizations/controller_helpers.rb'
369
+ - 'lib/organizations/models/invitation.rb'
370
+
371
+ # Offense count: 10
372
+ # This cop supports safe autocorrection (--autocorrect).
373
+ # Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames.
374
+ # RedundantRestArgumentNames: args, arguments
375
+ # RedundantKeywordRestArgumentNames: kwargs, options, opts
376
+ # RedundantBlockArgumentNames: blk, block, proc
377
+ Style/ArgumentsForwarding:
378
+ Exclude:
379
+ - 'lib/organizations/models/concerns/has_organizations.rb'
380
+ - 'lib/organizations/roles.rb'
381
+ - 'lib/organizations/view_helpers.rb'
382
+
383
+ # Offense count: 1
384
+ # This cop supports unsafe autocorrection (--autocorrect-all).
385
+ Style/CollectionQuerying:
386
+ Exclude:
387
+ - 'lib/organizations/models/concerns/has_organizations.rb'
388
+
389
+ # Offense count: 1
390
+ # This cop supports safe autocorrection (--autocorrect).
391
+ # Configuration parameters: Keywords, RequireColon.
392
+ # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE
393
+ Style/CommentAnnotation:
394
+ Exclude:
395
+ - 'app/controllers/organizations/memberships_controller.rb'
396
+
397
+ # Offense count: 1
398
+ # This cop supports safe autocorrection (--autocorrect).
399
+ # Configuration parameters: EnforcedStyle.
400
+ # SupportedStyles: compact, expanded
401
+ Style/EmptyMethod:
402
+ Exclude:
403
+ - 'app/controllers/organizations/organizations_controller.rb'
404
+
405
+ # Offense count: 2
406
+ # This cop supports unsafe autocorrection (--autocorrect-all).
407
+ # Configuration parameters: EnforcedStyle.
408
+ # SupportedStyles: always, always_true, never
409
+ Style/FrozenStringLiteralComment:
410
+ Exclude:
411
+ - '**/*.arb'
412
+ - 'gemfiles/rails_7.2.gemfile'
413
+ - 'gemfiles/rails_8.1.gemfile'
414
+
415
+ # Offense count: 2
416
+ # This cop supports safe autocorrection (--autocorrect).
417
+ # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
418
+ Style/GuardClause:
419
+ Exclude:
420
+ - 'app/controllers/organizations/memberships_controller.rb'
421
+ - 'lib/organizations/configuration.rb'
422
+
423
+ # Offense count: 1
424
+ # Configuration parameters: MinBranchesCount.
425
+ Style/HashLikeCase:
426
+ Exclude:
427
+ - 'lib/organizations/view_helpers.rb'
428
+
429
+ # Offense count: 31
430
+ # This cop supports safe autocorrection (--autocorrect).
431
+ Style/IfUnlessModifier:
432
+ Exclude:
433
+ - 'app/controllers/organizations/memberships_controller.rb'
434
+ - 'lib/organizations/acts_as_tenant_integration.rb'
435
+ - 'lib/organizations/callbacks.rb'
436
+ - 'lib/organizations/configuration.rb'
437
+ - 'lib/organizations/controller_helpers.rb'
438
+ - 'lib/organizations/current_user_resolution.rb'
439
+ - 'lib/organizations/models/concerns/has_organizations.rb'
440
+ - 'lib/organizations/models/invitation.rb'
441
+ - 'lib/organizations/models/membership.rb'
442
+ - 'lib/organizations/models/organization.rb'
443
+ - 'lib/organizations/roles.rb'
444
+ - 'lib/organizations/test_helpers.rb'
445
+ - 'test/test_helper.rb'
446
+ - 'test/view_helpers_test.rb'
447
+
448
+ # Offense count: 1
449
+ # This cop supports safe autocorrection (--autocorrect).
450
+ Style/KeywordParametersOrder:
451
+ Exclude:
452
+ - 'lib/organizations/test_helpers.rb'
453
+
454
+ # Offense count: 10
455
+ # This cop supports safe autocorrection (--autocorrect).
456
+ # Configuration parameters: EnforcedStyle.
457
+ # SupportedStyles: line_count_dependent, lambda, literal
458
+ Style/Lambda:
459
+ Exclude:
460
+ - 'lib/organizations/models/invitation.rb'
461
+ - 'lib/organizations/models/membership.rb'
462
+ - 'lib/organizations/models/organization.rb'
463
+ - 'test/controller_helpers_test.rb'
464
+ - 'test/data_integrity_test.rb'
465
+ - 'test/models/invitation_test.rb'
466
+
467
+ # Offense count: 1
468
+ # This cop supports safe autocorrection (--autocorrect).
469
+ Style/MultilineTernaryOperator:
470
+ Exclude:
471
+ - 'app/controllers/organizations/invitations_controller.rb'
472
+
473
+ # Offense count: 1
474
+ # This cop supports safe autocorrection (--autocorrect).
475
+ # Configuration parameters: AllowMethodComparison, ComparisonsThreshold.
476
+ Style/MultipleComparison:
477
+ Exclude:
478
+ - 'test/models/organization_test.rb'
479
+
480
+ # Offense count: 1
481
+ # This cop supports safe autocorrection (--autocorrect).
482
+ Style/NestedTernaryOperator:
483
+ Exclude:
484
+ - 'app/controllers/organizations/invitations_controller.rb'
485
+
486
+ # Offense count: 2
487
+ # This cop supports unsafe autocorrection (--autocorrect-all).
488
+ # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
489
+ # SupportedStyles: predicate, comparison
490
+ Style/NumericPredicate:
491
+ Exclude:
492
+ - 'spec/**/*'
493
+ - 'lib/organizations/roles.rb'
494
+ - 'test/models/invitation_test.rb'
495
+
496
+ # Offense count: 1
497
+ # This cop supports unsafe autocorrection (--autocorrect-all).
498
+ Style/PredicateWithKind:
499
+ Exclude:
500
+ - 'test/models/organization_test.rb'
501
+
502
+ # Offense count: 2
503
+ # This cop supports safe autocorrection (--autocorrect).
504
+ Style/RedundantBegin:
505
+ Exclude:
506
+ - 'app/controllers/organizations/invitations_controller.rb'
507
+ - 'app/controllers/organizations/organizations_controller.rb'
508
+
509
+ # Offense count: 2
510
+ # This cop supports safe autocorrection (--autocorrect).
511
+ Style/RedundantException:
512
+ Exclude:
513
+ - 'test/callbacks_test.rb'
514
+ - 'test/controller_helpers_test.rb'
515
+
516
+ # Offense count: 2
517
+ # This cop supports safe autocorrection (--autocorrect).
518
+ Style/RedundantParentheses:
519
+ Exclude:
520
+ - 'app/controllers/organizations/application_controller.rb'
521
+ - 'app/controllers/organizations/public_controller.rb'
522
+
523
+ # Offense count: 2
524
+ # This cop supports safe autocorrection (--autocorrect).
525
+ Style/RescueModifier:
526
+ Exclude:
527
+ - 'app/controllers/organizations/application_controller.rb'
528
+ - 'app/controllers/organizations/public_controller.rb'
529
+
530
+ # Offense count: 1
531
+ # This cop supports unsafe autocorrection (--autocorrect-all).
532
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
533
+ # AllowedMethods: present?, blank?, presence, try, try!
534
+ Style/SafeNavigation:
535
+ Exclude:
536
+ - 'lib/organizations/models/concerns/has_organizations.rb'
537
+
538
+ # Offense count: 2
539
+ # Configuration parameters: Max.
540
+ Style/SafeNavigationChainLength:
541
+ Exclude:
542
+ - 'app/mailers/organizations/invitation_mailer.rb'
543
+
544
+ # Offense count: 1
545
+ # This cop supports safe autocorrection (--autocorrect).
546
+ # Configuration parameters: AllowAsExpressionSeparator.
547
+ Style/Semicolon:
548
+ Exclude:
549
+ - 'test/concerns/has_organizations_test.rb'
550
+
551
+ # Offense count: 2
552
+ # This cop supports safe autocorrection (--autocorrect).
553
+ # Configuration parameters: AllowModifier.
554
+ Style/SoleNestedConditional:
555
+ Exclude:
556
+ - 'lib/organizations/controller_helpers.rb'
557
+ - 'lib/organizations/models/invitation.rb'
558
+
559
+ # Offense count: 1
560
+ # This cop supports unsafe autocorrection (--autocorrect-all).
561
+ # Configuration parameters: Mode.
562
+ Style/StringConcatenation:
563
+ Exclude:
564
+ - '.simplecov'
565
+
566
+ # Offense count: 1
567
+ # This cop supports safe autocorrection (--autocorrect).
568
+ # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
569
+ # SupportedStyles: single_quotes, double_quotes
570
+ Style/StringLiterals:
571
+ Exclude:
572
+ - '.simplecov'
573
+
574
+ # Offense count: 9
575
+ # This cop supports safe autocorrection (--autocorrect).
576
+ # Configuration parameters: .
577
+ # SupportedStyles: percent, brackets
578
+ Style/SymbolArray:
579
+ EnforcedStyle: percent
580
+ MinSize: 8
581
+
582
+ # Offense count: 3
583
+ # This cop supports unsafe autocorrection (--autocorrect-all).
584
+ # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
585
+ # AllowedMethods: define_method
586
+ Style/SymbolProc:
587
+ Exclude:
588
+ - 'app/controllers/organizations/organizations_controller.rb'
589
+ - 'test/callbacks_test.rb'
590
+ - 'test/data_integrity_test.rb'
591
+
592
+ # Offense count: 2
593
+ # This cop supports safe autocorrection (--autocorrect).
594
+ # Configuration parameters: AllowNamedUnderscoreVariables.
595
+ Style/TrailingUnderscoreVariable:
596
+ Exclude:
597
+ - 'test/data_integrity_test.rb'
598
+
599
+ # Offense count: 1
600
+ # This cop supports unsafe autocorrection (--autocorrect-all).
601
+ Style/ZeroLengthPredicate:
602
+ Exclude:
603
+ - 'test/models/invitation_test.rb'
604
+
605
+ # Offense count: 33
606
+ # This cop supports safe autocorrection (--autocorrect).
607
+ # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
608
+ # URISchemes: http, https
609
+ Layout/LineLength:
610
+ Exclude:
611
+ - 'app/controllers/organizations/application_controller.rb'
612
+ - 'app/controllers/organizations/memberships_controller.rb'
613
+ - 'app/controllers/organizations/organizations_controller.rb'
614
+ - 'app/controllers/organizations/public_invitations_controller.rb'
615
+ - 'app/controllers/organizations/switch_controller.rb'
616
+ - 'lib/generators/organizations/install/install_generator.rb'
617
+ - 'lib/organizations/configuration.rb'
618
+ - 'lib/organizations/controller_helpers.rb'
619
+ - 'lib/organizations/models/concerns/has_organizations.rb'
620
+ - 'lib/organizations/view_helpers.rb'
621
+ - 'organizations.gemspec'
622
+ - 'test/concerns/has_organizations_test.rb'
623
+ - 'test/data_integrity_test.rb'
624
+ - 'test/regression/bugfix_regression_test.rb'
625
+ - 'test/view_helpers_test.rb'