solargraph-rails 1.2.0 → 1.2.1

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: 5805a34ade746eabc3ae7e5f304bd695b19fb2ec997f0fa436530c4954f26e94
4
- data.tar.gz: a4bc0f6c610f76165cddf26f27e8eefecb0996ac9c836bbc1c9e24a8b3df5ca3
3
+ metadata.gz: 340a0d1ac34fa10db4c2ebddb4ceb55c803f33a19a42f606ebc5e294eac68505
4
+ data.tar.gz: c4653edadf0fb829a7c040b70aaf6697e504337f5a6337635f03e6b3652a551a
5
5
  SHA512:
6
- metadata.gz: ca807080c14c79a539f2452d63bebb57d9b977598b9df5e02d53048a0be03cf644a1a81b322b09e55dee2d07657973f60c5a856c1b167b622e2f17f9192c4994
7
- data.tar.gz: cc1901a6eab796d45178d5b4f06e8339edd422a61123e2c20f1580d48d9778d83e6c2d600f02ae76067b535e81e10b705c702ac706a0e924b4500171241b087c
6
+ metadata.gz: a35c2b38aeb0a51a4f5b1009e2d601878d30802361444d837e99428e3898cefe70940e7439ac99602c28a55587214f283be185c57b4c9805ebece4e18c972d72
7
+ data.tar.gz: c47bd5684b92f1b4edbbf6eb0874c8ba7abe53cacb7f8f1fdd43cadd34b2af0b3d1da5dfc2b75c9a54aa2298ac7ea88d8afee47985cee225a6c3903ea667ad9f
@@ -4,7 +4,7 @@
4
4
  # act pull_release -j overcommit
5
5
  #
6
6
 
7
- name: Overcommit
7
+ name: Linter
8
8
 
9
9
  on:
10
10
  workflow_dispatch: {}
@@ -16,6 +16,9 @@ on:
16
16
  tags:
17
17
  - 'v*'
18
18
 
19
+ permissions:
20
+ pull-requests: write
21
+
19
22
  jobs:
20
23
  overcommit:
21
24
  runs-on: ubuntu-latest
@@ -28,7 +31,7 @@ jobs:
28
31
  rails-minor: "0"
29
32
  run_coverage: true
30
33
  solargraph-version:
31
- - "0.56.alpha"
34
+ - "0.57.alpha"
32
35
  fail-fast: false
33
36
  steps:
34
37
  - uses: actions/checkout@v2
@@ -69,3 +72,23 @@ jobs:
69
72
  MATRIX_SOLARGRAPH_VERSION: ${{ matrix.solargraph-version }}
70
73
  MATRIX_RAILS_VERSION: ${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}
71
74
  MATRIX_RAILS_MAJOR_VERSION: ${{ matrix.versions.rails-major }}
75
+ rubocop:
76
+ name: rubocop
77
+ runs-on: ubuntu-latest
78
+ env:
79
+ BUNDLE_ONLY: rubocop
80
+ steps:
81
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
82
+ - uses: ruby/setup-ruby@1a615958ad9d422dd932dc1d5823942ee002799f # v1.227.0
83
+ with:
84
+ ruby-version: '3.3'
85
+ bundler-cache: true
86
+ - uses: reviewdog/action-rubocop@fcb74ba274da10b18d038d0bcddaae3518739634 # v2.21.2
87
+ with:
88
+ reporter: github-pr-check
89
+ skip_install: true
90
+ use_bundler: true
91
+ rubocop_extensions: 'rubocop-performance:gemfile rubocop-rspec:gemfile rubocop-rake:gemfile rubocop-yard:gemfile'
92
+ fail_level: info
93
+ rubocop_version: Gemfile
94
+ level: info
@@ -3,7 +3,7 @@
3
3
  # act pull_request
4
4
  #
5
5
 
6
- name: Ruby
6
+ name: Test
7
7
 
8
8
  on:
9
9
  workflow_dispatch: {}
@@ -16,7 +16,7 @@ on:
16
16
  - 'v*'
17
17
 
18
18
  jobs:
19
- test:
19
+ rspec:
20
20
  runs-on: ubuntu-latest
21
21
  strategy:
22
22
  matrix:
@@ -33,7 +33,7 @@ jobs:
33
33
  - ruby: "3.1"
34
34
  rails-major: "7"
35
35
  rails-minor: "2"
36
- # # ruby 3.2 is minimum Ruby supported by Rails 8.0
36
+ # ruby 3.2 is minimum Ruby supported by Rails 8.0
37
37
  - ruby: "3.2"
38
38
  rails-major: "8"
39
39
  rails-minor: "0"
@@ -43,14 +43,16 @@ jobs:
43
43
  - "0.50.0"
44
44
  - "0.51.2"
45
45
  - "0.52.0"
46
- - "0.56.alpha"
47
46
  - "0.56.0"
47
+ - "0.56.1"
48
+ - "0.56.2"
49
+ - "0.57.alpha"
48
50
  include:
49
51
  - versions:
50
52
  ruby: "3.2"
51
53
  rails-major: "8"
52
54
  rails-minor: "0"
53
- solargraph-version: "0.56.alpha"
55
+ solargraph-version: "0.57.alpha"
54
56
  run_coverage: true
55
57
  fail-fast: false
56
58
  steps:
@@ -68,6 +70,15 @@ jobs:
68
70
  MATRIX_RAILS_MAJOR_VERSION: ${{ matrix.versions.rails-major }}
69
71
  MATRIX_RAILS_VERSION: ${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}
70
72
 
73
+ - name: Update solargraph from branch if needed
74
+ run: |
75
+ bundle update solargraph
76
+ env:
77
+ # Used in Gemfile/gemspec
78
+ MATRIX_SOLARGRAPH_VERSION: ${{ matrix.solargraph-version }}
79
+ MATRIX_RAILS_MAJOR_VERSION: ${{ matrix.versions.rails-major }}
80
+ MATRIX_RAILS_VERSION: ${{ matrix.versions.rails-major }}.${{ matrix.versions.rails-minor }}
81
+
71
82
  - name: Install child bundle
72
83
  run: |
73
84
  set -x
@@ -82,8 +93,11 @@ jobs:
82
93
  # don't pay attention to the rbs collection regardless
83
94
  if [[ "$MATRIX_SOLARGRAPH_VERSION" != "0.48.0" && "$MATRIX_SOLARGRAPH_VERSION" != "0.49.0" && "$MATRIX_SOLARGRAPH_VERSION" != "0.50.0" ]]
84
95
  then
96
+ cd ../..
97
+ bundle update rbs
98
+ cd ${RAILS_DIR}
85
99
  bundle exec --gemfile ../../Gemfile rbs --version
86
- bundle exec --gemfile ../../Gemfile rbs collection install
100
+ bundle exec --gemfile ../../Gemfile rbs collection update
87
101
  fi
88
102
  cd ../..
89
103
  env:
@@ -17,7 +17,7 @@ on:
17
17
  - 'v*'
18
18
 
19
19
  jobs:
20
- typecheck:
20
+ solargraph:
21
21
  runs-on: ubuntu-latest
22
22
  steps:
23
23
  - uses: actions/checkout@v2
@@ -62,6 +62,8 @@ jobs:
62
62
  # same as used by ruby/setup-ruby
63
63
  ruby --version
64
64
  bundle install
65
+ # reject known bad versions
66
+ echo 'gem "solargraph", ["!= 0.56.2"]' >> .Gemfile
65
67
  bundle update solargraph
66
68
  bundle exec solargraph version
67
69
  # SOLARGRAPH_ASSERTS=on
data/.rubocop.yml CHANGED
@@ -118,6 +118,9 @@ Naming/BlockForwarding: # new in 1.24
118
118
  Enabled: true
119
119
  Naming/PredicateMethod: # new in 1.76
120
120
  Enabled: true
121
+ Naming/PredicatePrefix:
122
+ Exclude:
123
+ - lib/solargraph/rails/annotations/**/*.rb
121
124
  Security/CompoundHash: # new in 1.28
122
125
  Enabled: true
123
126
  Security/IoMethods: # new in 1.22
@@ -218,6 +221,9 @@ Style/OpenStructUse: # new in 1.23
218
221
  Enabled: true
219
222
  Style/OperatorMethodCall: # new in 1.37
220
223
  Enabled: true
224
+ Style/OptionalBooleanParameter:
225
+ Exclude:
226
+ - lib/solargraph/rails/annotations/**/*.rb
221
227
  Style/QuotedSymbols: # new in 1.16
222
228
  Enabled: true
223
229
  Style/RedundantArgument: # new in 1.4
@@ -325,3 +331,4 @@ plugins:
325
331
  - rubocop-performance
326
332
  - rubocop-rspec
327
333
  - rubocop-rake
334
+ - rubocop-yard
data/.rubocop_todo.yml CHANGED
@@ -1,12 +1,12 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-06-18 12:12:37 UTC using RuboCop version 1.76.1.
3
+ # on 2025-07-11 18:58:31 UTC using RuboCop version 1.78.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 4
9
+ # Offense count: 5
10
10
  # This cop supports safe autocorrection (--autocorrect).
11
11
  # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
12
  # Include: **/*.gemfile, **/Gemfile, **/gems.rb
@@ -24,7 +24,7 @@ Gemspec/AddRuntimeDependency:
24
24
  Exclude:
25
25
  - 'solargraph-rails.gemspec'
26
26
 
27
- # Offense count: 4
27
+ # Offense count: 6
28
28
  # Configuration parameters: EnforcedStyle, AllowedGems, Include.
29
29
  # SupportedStyles: Gemfile, gems.rb, gemspec
30
30
  # Include: **/*.gemspec, **/Gemfile, **/gems.rb
@@ -65,20 +65,12 @@ Layout/BlockAlignment:
65
65
  Exclude:
66
66
  - 'spec/solargraph-rails/annotate_spec.rb'
67
67
 
68
- # Offense count: 4
68
+ # Offense count: 3
69
69
  # This cop supports safe autocorrection (--autocorrect).
70
70
  Layout/ClosingHeredocIndentation:
71
71
  Exclude:
72
- - 'spec/helpers.rb'
73
72
  - 'spec/solargraph-rails/rails_spec.rb'
74
73
 
75
- # Offense count: 2
76
- # This cop supports safe autocorrection (--autocorrect).
77
- # Configuration parameters: AllowForAlignment.
78
- Layout/CommentIndentation:
79
- Exclude:
80
- - 'Gemfile'
81
-
82
74
  # Offense count: 1
83
75
  # This cop supports safe autocorrection (--autocorrect).
84
76
  Layout/ElseAlignment:
@@ -103,14 +95,12 @@ Layout/EmptyLineBetweenDefs:
103
95
  Exclude:
104
96
  - 'lib/solargraph/rails/model.rb'
105
97
 
106
- # Offense count: 4
98
+ # Offense count: 2
107
99
  # This cop supports safe autocorrection (--autocorrect).
108
100
  Layout/EmptyLines:
109
101
  Exclude:
110
102
  - 'lib/solargraph/rails/model.rb'
111
103
  - 'solargraph-rails.gemspec'
112
- - 'spec/helpers.rb'
113
- - 'spec/solargraph-rails/rails_spec.rb'
114
104
 
115
105
  # Offense count: 3
116
106
  # This cop supports safe autocorrection (--autocorrect).
@@ -121,14 +111,6 @@ Layout/EmptyLinesAroundAttributeAccessor:
121
111
  - 'lib/solargraph/rails/walker.rb'
122
112
  - 'spec/helpers.rb'
123
113
 
124
- # Offense count: 1
125
- # This cop supports safe autocorrection (--autocorrect).
126
- # Configuration parameters: EnforcedStyle.
127
- # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
128
- Layout/EmptyLinesAroundClassBody:
129
- Exclude:
130
- - 'lib/solargraph/rails/annotations/active_record.rb'
131
-
132
114
  # Offense count: 1
133
115
  # This cop supports safe autocorrection (--autocorrect).
134
116
  # Configuration parameters: EnforcedStyleAlignWith, Severity.
@@ -154,11 +136,10 @@ Layout/HashAlignment:
154
136
  Exclude:
155
137
  - 'lib/solargraph/rails/schema.rb'
156
138
 
157
- # Offense count: 8
139
+ # Offense count: 7
158
140
  # This cop supports safe autocorrection (--autocorrect).
159
141
  Layout/HeredocIndentation:
160
142
  Exclude:
161
- - 'spec/helpers.rb'
162
143
  - 'spec/solargraph-rails/annotate_spec.rb'
163
144
  - 'spec/solargraph-rails/model_spec.rb'
164
145
  - 'spec/solargraph-rails/rails_spec.rb'
@@ -235,12 +216,6 @@ Lint/BooleanSymbol:
235
216
  - 'lib/solargraph/rails/delegate.rb'
236
217
  - 'lib/solargraph/rails/model.rb'
237
218
 
238
- # Offense count: 1
239
- # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
240
- Lint/DuplicateBranch:
241
- Exclude:
242
- - 'spec/helpers.rb'
243
-
244
219
  # Offense count: 1
245
220
  Lint/DuplicateMethods:
246
221
  Exclude:
@@ -263,11 +238,6 @@ Lint/RedundantStringCoercion:
263
238
  Exclude:
264
239
  - 'script/generate_definitions.rb'
265
240
 
266
- # Offense count: 1
267
- Lint/SelfAssignment:
268
- Exclude:
269
- - 'script/generate_definitions.rb'
270
-
271
241
  # Offense count: 1
272
242
  Lint/SharedMutableDefault:
273
243
  Exclude:
@@ -290,20 +260,19 @@ Lint/UnusedMethodArgument:
290
260
  - 'lib/solargraph-rails.rb'
291
261
  - 'spec/helpers.rb'
292
262
 
293
- # Offense count: 4
263
+ # Offense count: 3
294
264
  # This cop supports safe autocorrection (--autocorrect).
295
265
  # Configuration parameters: AutoCorrect.
296
266
  Lint/UselessAssignment:
297
267
  Exclude:
298
268
  - 'lib/solargraph/rails/delegate.rb'
299
- - 'script/generate_definitions.rb'
300
269
  - 'spec/helpers.rb'
301
270
  - 'spec/spec_helper.rb'
302
271
 
303
- # Offense count: 17
272
+ # Offense count: 22
304
273
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
305
274
  Metrics/AbcSize:
306
- Max: 124
275
+ Max: 104
307
276
 
308
277
  # Offense count: 2
309
278
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
@@ -311,40 +280,30 @@ Metrics/AbcSize:
311
280
  Metrics/BlockLength:
312
281
  Max: 32
313
282
 
314
- # Offense count: 1
315
- # Configuration parameters: CountBlocks, CountModifierForms.
316
- Metrics/BlockNesting:
317
- Max: 4
318
-
319
- # Offense count: 2
283
+ # Offense count: 3
320
284
  # Configuration parameters: CountComments, CountAsOne.
321
285
  Metrics/ClassLength:
322
286
  Max: 252
323
287
 
324
- # Offense count: 9
288
+ # Offense count: 11
325
289
  # Configuration parameters: AllowedMethods, AllowedPatterns.
326
290
  Metrics/CyclomaticComplexity:
327
- Max: 46
291
+ Max: 36
328
292
 
329
- # Offense count: 20
293
+ # Offense count: 23
330
294
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
331
295
  Metrics/MethodLength:
332
- Max: 116
333
-
334
- # Offense count: 1
335
- # Configuration parameters: CountComments, CountAsOne.
336
- Metrics/ModuleLength:
337
- Max: 231
296
+ Max: 75
338
297
 
339
298
  # Offense count: 1
340
299
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
341
300
  Metrics/ParameterLists:
342
301
  Max: 9
343
302
 
344
- # Offense count: 8
303
+ # Offense count: 10
345
304
  # Configuration parameters: AllowedMethods, AllowedPatterns.
346
305
  Metrics/PerceivedComplexity:
347
- Max: 52
306
+ Max: 41
348
307
 
349
308
  # Offense count: 6
350
309
  # This cop supports safe autocorrection (--autocorrect).
@@ -381,7 +340,7 @@ Naming/MemoizedInstanceVariableName:
381
340
  Exclude:
382
341
  - 'lib/solargraph/rails/schema.rb'
383
342
 
384
- # Offense count: 23
343
+ # Offense count: 21
385
344
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
386
345
  # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
387
346
  Naming/MethodParameterName:
@@ -397,7 +356,6 @@ Naming/MethodParameterName:
397
356
  - 'lib/solargraph/rails/schema.rb'
398
357
  - 'lib/solargraph/rails/storage.rb'
399
358
  - 'lib/solargraph/rails/util.rb'
400
- - 'spec/helpers.rb'
401
359
 
402
360
  # Offense count: 2
403
361
  # This cop supports safe autocorrection (--autocorrect).
@@ -426,13 +384,6 @@ Performance/ConstantRegexp:
426
384
  Exclude:
427
385
  - 'spec/rails8/bin/bundle'
428
386
 
429
- # Offense count: 1
430
- # This cop supports safe autocorrection (--autocorrect).
431
- # Configuration parameters: IncludeActiveSupportAliases.
432
- Performance/DoubleStartEndWith:
433
- Exclude:
434
- - 'spec/helpers.rb'
435
-
436
387
  # Offense count: 1
437
388
  # Configuration parameters: Prefixes, AllowedPatterns.
438
389
  # Prefixes: when, with, without
@@ -459,7 +410,7 @@ RSpec/DescribedClass:
459
410
  Exclude:
460
411
  - 'spec/solargraph-rails/annotate_spec.rb'
461
412
 
462
- # Offense count: 26
413
+ # Offense count: 27
463
414
  # Configuration parameters: CountAsOne.
464
415
  RSpec/ExampleLength:
465
416
  Max: 32
@@ -511,7 +462,7 @@ RSpec/SpecFilePathFormat:
511
462
  - 'spec/solargraph-rails/schema_spec.rb'
512
463
  - 'spec/solargraph-rails/storage_spec.rb'
513
464
 
514
- # Offense count: 10
465
+ # Offense count: 4
515
466
  # This cop supports safe autocorrection (--autocorrect).
516
467
  # Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames.
517
468
  # RedundantRestArgumentNames: args, arguments
@@ -520,10 +471,8 @@ RSpec/SpecFilePathFormat:
520
471
  Style/ArgumentsForwarding:
521
472
  Exclude:
522
473
  - 'lib/solargraph/rails/walker.rb'
523
- - 'spec/helpers.rb'
524
- - 'spec/rails8/bin/setup'
525
474
 
526
- # Offense count: 11
475
+ # Offense count: 13
527
476
  # This cop supports unsafe autocorrection (--autocorrect-all).
528
477
  # Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
529
478
  # SupportedStyles: nested, compact
@@ -552,19 +501,11 @@ Style/ConditionalAssignment:
552
501
  Exclude:
553
502
  - 'spec/helpers.rb'
554
503
 
555
- # Offense count: 32
504
+ # Offense count: 39
556
505
  # Configuration parameters: AllowedConstants.
557
506
  Style/Documentation:
558
507
  Enabled: false
559
508
 
560
- # Offense count: 1
561
- # This cop supports safe autocorrection (--autocorrect).
562
- # Configuration parameters: AutoCorrect, EnforcedStyle.
563
- # SupportedStyles: compact, expanded
564
- Style/EmptyMethod:
565
- Exclude:
566
- - 'lib/solargraph/rails/annotations/active_record.rb'
567
-
568
509
  # Offense count: 1
569
510
  # This cop supports safe autocorrection (--autocorrect).
570
511
  Style/ExpandPathArguments:
@@ -573,14 +514,14 @@ Style/ExpandPathArguments:
573
514
 
574
515
  # Offense count: 10
575
516
  # This cop supports safe autocorrection (--autocorrect).
576
- # Configuration parameters: AllowedVars.
517
+ # Configuration parameters: AllowedVars, DefaultToNil.
577
518
  Style/FetchEnvVar:
578
519
  Exclude:
579
520
  - 'Gemfile'
580
521
  - 'solargraph-rails.gemspec'
581
522
  - 'spec/rails8/bin/bundle'
582
523
 
583
- # Offense count: 81
524
+ # Offense count: 93
584
525
  # This cop supports unsafe autocorrection (--autocorrect-all).
585
526
  # Configuration parameters: EnforcedStyle.
586
527
  # SupportedStyles: always, always_true, never
@@ -597,7 +538,7 @@ Style/GlobalStdStream:
597
538
  - 'spec/rails8/bin/setup'
598
539
  - 'spec/rails8/config/environments/production.rb'
599
540
 
600
- # Offense count: 2
541
+ # Offense count: 1
601
542
  # This cop supports safe autocorrection (--autocorrect).
602
543
  # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
603
544
  Style/GuardClause:
@@ -622,11 +563,10 @@ Style/HashSyntax:
622
563
  - 'Rakefile'
623
564
  - 'spec/solargraph-rails/schema_spec.rb'
624
565
 
625
- # Offense count: 7
566
+ # Offense count: 2
626
567
  # This cop supports safe autocorrection (--autocorrect).
627
568
  Style/IfUnlessModifier:
628
569
  Exclude:
629
- - 'spec/helpers.rb'
630
570
  - 'spec/rails8/bin/bundle'
631
571
 
632
572
  # Offense count: 1
@@ -650,13 +590,6 @@ Style/MutableConstant:
650
590
  - 'lib/solargraph/rails/schema.rb'
651
591
  - 'lib/solargraph/rails/version.rb'
652
592
 
653
- # Offense count: 1
654
- # This cop supports safe autocorrection (--autocorrect).
655
- # Configuration parameters: IncludeSemanticChanges.
656
- Style/NonNilCheck:
657
- Exclude:
658
- - 'spec/helpers.rb'
659
-
660
593
  # Offense count: 1
661
594
  # This cop supports unsafe autocorrection (--autocorrect-all).
662
595
  # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
@@ -666,13 +599,6 @@ Style/NumericPredicate:
666
599
  - 'spec/**/*'
667
600
  - 'Gemfile'
668
601
 
669
- # Offense count: 1
670
- # Configuration parameters: AllowedMethods.
671
- # AllowedMethods: respond_to_missing?
672
- Style/OptionalBooleanParameter:
673
- Exclude:
674
- - 'lib/solargraph/rails/annotations/time.rb'
675
-
676
602
  # Offense count: 1
677
603
  # This cop supports safe autocorrection (--autocorrect).
678
604
  Style/PerlBackrefs:
@@ -729,21 +655,13 @@ Style/ReturnNilInPredicateMethodDefinition:
729
655
  Exclude:
730
656
  - 'lib/solargraph/rails/walker.rb'
731
657
 
732
- # Offense count: 2
733
- # This cop supports unsafe autocorrection (--autocorrect-all).
734
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
735
- # AllowedMethods: present?, blank?, presence, try, try!
736
- Style/SafeNavigation:
737
- Exclude:
738
- - 'script/generate_definitions.rb'
739
-
740
658
  # Offense count: 1
741
659
  # This cop supports safe autocorrection (--autocorrect).
742
660
  Style/SelfAssignment:
743
661
  Exclude:
744
662
  - 'lib/solargraph/rails/util.rb'
745
663
 
746
- # Offense count: 6
664
+ # Offense count: 4
747
665
  # This cop supports unsafe autocorrection (--autocorrect-all).
748
666
  Style/SlicingWithRange:
749
667
  Exclude:
@@ -751,14 +669,6 @@ Style/SlicingWithRange:
751
669
  - 'lib/solargraph/rails/devise.rb'
752
670
  - 'lib/solargraph/rails/util.rb'
753
671
  - 'lib/solargraph/rails/walker.rb'
754
- - 'spec/helpers.rb'
755
-
756
- # Offense count: 1
757
- # This cop supports safe autocorrection (--autocorrect).
758
- # Configuration parameters: AllowModifier.
759
- Style/SoleNestedConditional:
760
- Exclude:
761
- - 'spec/helpers.rb'
762
672
 
763
673
  # Offense count: 1
764
674
  # This cop supports unsafe autocorrection (--autocorrect-all).
@@ -784,14 +694,14 @@ Style/StringConcatenation:
784
694
  - 'lib/solargraph-rails.rb'
785
695
  - 'spec/helpers.rb'
786
696
 
787
- # Offense count: 299
697
+ # Offense count: 321
788
698
  # This cop supports safe autocorrection (--autocorrect).
789
699
  # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
790
700
  # SupportedStyles: single_quotes, double_quotes
791
701
  Style/StringLiterals:
792
702
  Enabled: false
793
703
 
794
- # Offense count: 1
704
+ # Offense count: 3
795
705
  # This cop supports safe autocorrection (--autocorrect).
796
706
  # Configuration parameters: .
797
707
  # SupportedStyles: percent, brackets
@@ -799,13 +709,14 @@ Style/SymbolArray:
799
709
  EnforcedStyle: percent
800
710
  MinSize: 13
801
711
 
802
- # Offense count: 1
712
+ # Offense count: 2
803
713
  # This cop supports unsafe autocorrection (--autocorrect-all).
804
714
  # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
805
715
  # AllowedMethods: define_method
806
716
  Style/SymbolProc:
807
717
  Exclude:
808
718
  - 'spec/helpers.rb'
719
+ - 'spec/rails8/db/migrate/20250619165029_create_models.rb'
809
720
 
810
721
  # Offense count: 3
811
722
  # This cop supports safe autocorrection (--autocorrect).
@@ -839,19 +750,35 @@ Style/TrailingUnderscoreVariable:
839
750
  Exclude:
840
751
  - 'lib/solargraph/rails/rails_api.rb'
841
752
 
842
- # Offense count: 3
753
+ # Offense count: 2
843
754
  # This cop supports safe autocorrection (--autocorrect).
844
755
  # Configuration parameters: EnforcedStyle, MinSize, WordRegex.
845
756
  # SupportedStyles: percent, brackets
846
757
  Style/WordArray:
847
758
  Exclude:
848
759
  - 'lib/solargraph/rails/schema.rb'
849
- - 'spec/helpers.rb'
850
760
  - 'spec/solargraph-rails/schema_spec.rb'
851
761
 
852
- # Offense count: 10
762
+ # Offense count: 3
763
+ # This cop supports safe autocorrection (--autocorrect).
764
+ # Configuration parameters: EnforcedStylePrototypeName.
765
+ # SupportedStylesPrototypeName: before, after
766
+ YARD/MismatchName:
767
+ Exclude:
768
+ - 'lib/solargraph/rails/model.rb'
769
+ - 'lib/solargraph/rails/rails_api.rb'
770
+
771
+ # Offense count: 7
772
+ YARD/TagTypeSyntax:
773
+ Exclude:
774
+ - 'lib/solargraph/rails/annotations/active_record.rb'
775
+ - 'lib/solargraph/rails/annotations/date.rb'
776
+ - 'lib/solargraph/rails/annotations/time.rb'
777
+ - 'lib/solargraph/rails/model.rb'
778
+
779
+ # Offense count: 7
853
780
  # This cop supports safe autocorrection (--autocorrect).
854
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
781
+ # Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
855
782
  # URISchemes: http, https
856
783
  Layout/LineLength:
857
784
  Max: 198
data/.solargraph.yml CHANGED
@@ -1,6 +1,9 @@
1
1
  ---
2
2
  include:
3
3
  - "**/*.rb"
4
+ - "Gemfile"
5
+ - "Rakefile"
6
+ - "*.gemspec"
4
7
  exclude:
5
8
  - spec/**/*
6
9
  - lib/solargraph/rails/annotations/**/*
data/CHANGELOG.md CHANGED
@@ -2,9 +2,24 @@
2
2
 
3
3
  ## Changes
4
4
 
5
+ ### v1.2.1
6
+
7
+ Features / fixes:
8
+ - Add annotation for ActiveRecord::Base#reload
9
+ - Add annotation for Rails::Application.config
10
+ - Add static Rails::Application.config method annotation
11
+ - Retire earlier version expectations
12
+ - Fix changelog typo
13
+
14
+ Internal improvements:
15
+ - CI/testing improvements:
16
+ - Add PR comments, rubocop-yard
17
+ - Update rbs collection in specs
18
+ - Test current Solargraph pre-release PRs
19
+
5
20
  ### v1.2
6
21
 
7
- Most of these are courtesy of @grndr, with integration work by
22
+ Most of these are courtesy of @grncdr, with integration work by
8
23
  @iftheshoefritz and @apiology
9
24
 
10
25
  Features / fixes:
data/DEVELOPMENT.md CHANGED
@@ -73,7 +73,7 @@ Move .yml files into place, then make sure to review the script and uncomment re
73
73
  ## Preparing a release (maintainers)
74
74
 
75
75
  1. Look up [most recent release](https://rubygems.org/gems/solargraph-rails)
76
- 2. Open up [commit list](https://github.com/iftheshoefritz/solargraph-rails/compare/v1.1.2...main)
76
+ 2. Open up [commit list](https://github.com/iftheshoefritz/solargraph-rails/compare/v1.2.0...main)
77
77
  3. Update [CHANGELOG.md](./CHANGELOG.md)
78
78
  4. Flip to 'files changed view' and refine updates
79
79
  5. Bump [version](./lib/solargraph/rails/version.rb) appropriately
data/Gemfile CHANGED
@@ -35,6 +35,7 @@ group :development, :rubocop do
35
35
  gem 'rubocop-rake', require: false
36
36
  gem 'rubocop-rspec', require: false
37
37
  gem 'rubocop-performance', require: false
38
+ gem 'rubocop-yard', require: true
38
39
  gem 'overcommit'
39
40
  gem 'simplecov-lcov',
40
41
  github: 'apiology/simplecov-lcov',
@@ -52,11 +53,11 @@ gemspec
52
53
  solargraph_force_ci_version = (ENV['CI'] && ENV['MATRIX_SOLARGRAPH_VERSION'])
53
54
 
54
55
  case solargraph_force_ci_version
55
- when '0.56.alpha'
56
- gem 'solargraph',
56
+ when '0.57.alpha'
57
+ gem "solargraph",
57
58
  github: 'apiology/solargraph',
58
- branch: '2025-06-24'
59
- # path: '../solargraph'
59
+ branch: '2025-07-02'
60
+ # path: '../solargraph'
60
61
  end
61
62
 
62
63
  # Local gemfile for development tools, etc.
data/README.md CHANGED
@@ -74,6 +74,7 @@ plugins:
74
74
  ```
75
75
 
76
76
  ### Build YARD docs
77
+
77
78
  In the project root, run `yard gems`.
78
79
 
79
80
  ## Contributing
@@ -0,0 +1,11 @@
1
+ module ActionText
2
+ module Attribute
3
+ # @param name [String, Symbol]
4
+ # @param encrypted [Boolean]
5
+ # @param strict_loading [Boolean]
6
+ # @return [void]
7
+ def self.has_rich_text(name, encrypted = false, strict_loading = false); end
8
+ # @return [Array<String>]
9
+ def self.rich_text_association_names; end
10
+ end
11
+ end
@@ -0,0 +1,276 @@
1
+ module ActiveJob
2
+ module Callbacks
3
+ # These methods will be included into any Active Job object, adding
4
+ # callbacks for +perform+ and +enqueue+ methods.
5
+ module ClassMethods
6
+ # Defines a callback that will get called right before the
7
+ # job's perform method is executed.
8
+ #
9
+ # class VideoProcessJob < ActiveJob::Base
10
+ # queue_as :default
11
+ #
12
+ # before_perform do |job|
13
+ # UserMailer.notify_video_started_processing(job.arguments.first)
14
+ # end
15
+ #
16
+ # def perform(video_id)
17
+ # Video.find(video_id).process
18
+ # end
19
+ # end
20
+ #
21
+ #
22
+ # @yieldreturn [void]
23
+ # @return [void]
24
+ def before_perform(*filters, &blk); end
25
+
26
+ # Defines a callback that will get called right after the
27
+ # job's perform method has finished.
28
+ #
29
+ # class VideoProcessJob < ActiveJob::Base
30
+ # queue_as :default
31
+ #
32
+ # after_perform do |job|
33
+ # UserMailer.notify_video_processed(job.arguments.first)
34
+ # end
35
+ #
36
+ # def perform(video_id)
37
+ # Video.find(video_id).process
38
+ # end
39
+ # end
40
+ #
41
+ # @yieldreturn [void]
42
+ # @return [void]
43
+ def after_perform(*filters, &blk); end
44
+
45
+ # Defines a callback that will get called around the job's perform method.
46
+ #
47
+ # class VideoProcessJob < ActiveJob::Base
48
+ # queue_as :default
49
+ #
50
+ # around_perform do |job, block|
51
+ # UserMailer.notify_video_started_processing(job.arguments.first)
52
+ # block.call
53
+ # UserMailer.notify_video_processed(job.arguments.first)
54
+ # end
55
+ #
56
+ # def perform(video_id)
57
+ # Video.find(video_id).process
58
+ # end
59
+ # end
60
+ #
61
+ # You can access the return value of the job only if the execution wasn't halted.
62
+ #
63
+ # class VideoProcessJob < ActiveJob::Base
64
+ # around_perform do |job, block|
65
+ # value = block.call
66
+ # puts value # => "Hello World!"
67
+ # end
68
+ #
69
+ # def perform
70
+ # "Hello World!"
71
+ # end
72
+ # end
73
+ #
74
+ # @yieldreturn [void]
75
+ # @return [void]
76
+ def around_perform(*filters, &blk); end
77
+
78
+ # Defines a callback that will get called right before the
79
+ # job is enqueued.
80
+ #
81
+ # class VideoProcessJob < ActiveJob::Base
82
+ # queue_as :default
83
+ #
84
+ # before_enqueue do |job|
85
+ # $statsd.increment "enqueue-video-job.try"
86
+ # end
87
+ #
88
+ # def perform(video_id)
89
+ # Video.find(video_id).process
90
+ # end
91
+ # end
92
+ #
93
+ # @yieldreturn [void]
94
+ # @return [void]
95
+ def before_enqueue(*filters, &blk); end
96
+
97
+ # Defines a callback that will get called right after the
98
+ # job is enqueued.
99
+ #
100
+ # class VideoProcessJob < ActiveJob::Base
101
+ # queue_as :default
102
+ #
103
+ # after_enqueue do |job|
104
+ # $statsd.increment "enqueue-video-job.success"
105
+ # end
106
+ #
107
+ # def perform(video_id)
108
+ # Video.find(video_id).process
109
+ # end
110
+ # end
111
+ #
112
+ # @yieldreturn [void]
113
+ # @return [void]
114
+ def after_enqueue(*filters, &blk); end
115
+
116
+ # Defines a callback that will get called around the enqueuing
117
+ # of the job.
118
+ #
119
+ # class VideoProcessJob < ActiveJob::Base
120
+ # queue_as :default
121
+ #
122
+ # around_enqueue do |job, block|
123
+ # $statsd.time "video-job.process" do
124
+ # block.call
125
+ # end
126
+ # end
127
+ #
128
+ # def perform(video_id)
129
+ # Video.find(video_id).process
130
+ # end
131
+ # end
132
+ #
133
+ # @yieldreturn [void]
134
+ # @return [void]
135
+ def around_enqueue(*filters, &blk); end
136
+ end
137
+ end
138
+
139
+ module Exceptions
140
+ module ClassMethods
141
+ # Catch the exception and reschedule job for re-execution after so many seconds, for a specific number of attempts.
142
+ # If the exception keeps getting raised beyond the specified number of attempts, the exception is allowed to
143
+ # bubble up to the underlying queuing system, which may have its own retry mechanism or place it in a
144
+ # holding queue for inspection.
145
+ #
146
+ # You can also pass a block that'll be invoked if the retry attempts fail for custom logic rather than letting
147
+ # the exception bubble up. This block is yielded with the job instance as the first and the error instance as the second parameter.
148
+ #
149
+ # ==== Options
150
+ # * <tt>:wait</tt> - Re-enqueues the job with a delay specified either in seconds (default: 3 seconds),
151
+ # as a computing proc that takes the number of executions so far as an argument, or as a symbol reference of
152
+ # <tt>:exponentially_longer</tt>, which applies the wait algorithm of <tt>((executions**4) + (Kernel.rand * (executions**4) * jitter)) + 2</tt>
153
+ # (first wait ~3s, then ~18s, then ~83s, etc)
154
+ # * <tt>:attempts</tt> - Re-enqueues the job the specified number of times (default: 5 attempts) or a symbol reference of <tt>:unlimited</tt>
155
+ # to retry the job until it succeeds
156
+ # * <tt>:queue</tt> - Re-enqueues the job on a different queue
157
+ # * <tt>:priority</tt> - Re-enqueues the job with a different priority
158
+ # * <tt>:jitter</tt> - A random delay of wait time used when calculating backoff. The default is 15% (0.15) which represents the upper bound of possible wait time (expressed as a percentage)
159
+ #
160
+ # ==== Examples
161
+ #
162
+ # class RemoteServiceJob < ActiveJob::Base
163
+ # retry_on CustomAppException # defaults to ~3s wait, 5 attempts
164
+ # retry_on AnotherCustomAppException, wait: ->(executions) { executions * 2 }
165
+ # retry_on CustomInfrastructureException, wait: 5.minutes, attempts: :unlimited
166
+ #
167
+ # retry_on ActiveRecord::Deadlocked, wait: 5.seconds, attempts: 3
168
+ # retry_on Net::OpenTimeout, Timeout::Error, wait: :exponentially_longer, attempts: 10 # retries at most 10 times for Net::OpenTimeout and Timeout::Error combined
169
+ # # To retry at most 10 times for each individual exception:
170
+ # # retry_on Net::OpenTimeout, wait: :exponentially_longer, attempts: 10
171
+ # # retry_on Net::ReadTimeout, wait: 5.seconds, jitter: 0.30, attempts: 10
172
+ # # retry_on Timeout::Error, wait: :exponentially_longer, attempts: 10
173
+ #
174
+ # retry_on(YetAnotherCustomAppException) do |job, error|
175
+ # ExceptionNotifier.caught(error)
176
+ # end
177
+ #
178
+ # def perform(*args)
179
+ # # Might raise CustomAppException, AnotherCustomAppException, or YetAnotherCustomAppException for something domain specific
180
+ # # Might raise ActiveRecord::Deadlocked when a local db deadlock is detected
181
+ # # Might raise Net::OpenTimeout or Timeout::Error when the remote service is down
182
+ # end
183
+ # end
184
+ #
185
+ # @yieldreturn [void]
186
+ # @return [void]
187
+ def retry_on(*exceptions, wait: 3.seconds, attempts: 5, queue: nil, priority: nil, jitter: JITTER_DEFAULT); end
188
+
189
+ # Discard the job with no attempts to retry, if the exception is raised. This is useful when the subject of the job,
190
+ # like an Active Record, is no longer available, and the job is thus no longer relevant.
191
+ #
192
+ # You can also pass a block that'll be invoked. This block is yielded with the job instance as the first and the error instance as the second parameter.
193
+ #
194
+ # ==== Example
195
+ #
196
+ # class SearchIndexingJob < ActiveJob::Base
197
+ # discard_on ActiveJob::DeserializationError
198
+ # discard_on(CustomAppException) do |job, error|
199
+ # ExceptionNotifier.caught(error)
200
+ # end
201
+ #
202
+ # def perform(record)
203
+ # # Will raise ActiveJob::DeserializationError if the record can't be deserialized
204
+ # # Might raise CustomAppException for something domain specific
205
+ # end
206
+ # end
207
+ #
208
+ # @yieldreturn [void]
209
+ # @return [void]
210
+ def discard_on(*exceptions); end
211
+ end
212
+ end
213
+
214
+ module QueueName
215
+ extend ActiveSupport::Concern
216
+
217
+ # Includes the ability to override the default queue name and prefix.
218
+ module ClassMethods
219
+ mattr_accessor :default_queue_name, default: "default"
220
+
221
+ # Specifies the name of the queue to process the job on.
222
+ #
223
+ # class PublishToFeedJob < ActiveJob::Base
224
+ # queue_as :feeds
225
+ #
226
+ # def perform(post)
227
+ # post.to_feed!
228
+ # end
229
+ # end
230
+ #
231
+ # Can be given a block that will evaluate in the context of the job
232
+ # so that a dynamic queue name can be applied:
233
+ #
234
+ # class PublishToFeedJob < ApplicationJob
235
+ # queue_as do
236
+ # post = self.arguments.first
237
+ #
238
+ # if post.paid?
239
+ # :paid_feeds
240
+ # else
241
+ # :feeds
242
+ # end
243
+ # end
244
+ #
245
+ # def perform(post)
246
+ # post.to_feed!
247
+ # end
248
+ # end
249
+ #
250
+ # @return [void]
251
+ def queue_as(part_name = nil, &block); end
252
+ end
253
+ end
254
+
255
+ module QueuePriority
256
+ extend ActiveSupport::Concern
257
+
258
+ # Includes the ability to override the default queue priority.
259
+ module ClassMethods
260
+ # Specifies the priority of the queue to create the job with.
261
+ #
262
+ # class PublishToFeedJob < ActiveJob::Base
263
+ # queue_with_priority 50
264
+ #
265
+ # def perform(post)
266
+ # post.to_feed!
267
+ # end
268
+ # end
269
+ #
270
+ # Specify either an argument or a block.
271
+ #
272
+ # @return [void]
273
+ def queue_with_priority(priority = nil, &block); end
274
+ end
275
+ end
276
+ end
@@ -1,9 +1,14 @@
1
+ require 'active_record'
2
+
1
3
  class ActiveRecord::ConnectionAdapters::SchemaStatements
2
4
  # @yieldparam [ActiveRecord::ConnectionAdapters::TableDefinition]
3
5
  # @return [void]
4
6
  def create_table(table_name, id: nil, primary_key: nil, force: false, **options); end
5
7
  # @yieldparam [ActiveRecord::ConnectionAdapters::TableDefinition]
8
+ # @param table_1 [String, Symbol]
9
+ # @param table_2 [String, Symbol]
6
10
  # @param column_options [Hash]
11
+ # @param options [Hash{Symbol => undefined}]
7
12
  # @return [void]
8
13
  def create_join_table(table_1, table_2, column_options: {}, **options); end
9
14
  # @yieldparam [ActiveRecord::ConnectionAdapters::Table]
@@ -11,6 +16,12 @@ class ActiveRecord::ConnectionAdapters::SchemaStatements
11
16
  def change_table(table_name, **options); end
12
17
  end
13
18
 
19
+ module ActiveRecord::Core
20
+ # @param methods [Symbol]
21
+ # @return [ActiveSupport::HashWithIndifferentAccess<Symbol>]
22
+ def slice(*methods); end
23
+ end
24
+
14
25
  # this module doesn't really exist, it's here to avoid repeating these mixins
15
26
  module ActiveRecord::RelationMethods
16
27
  include Enumerable
@@ -43,15 +54,34 @@ class ActiveRecord::Base
43
54
  # below
44
55
  include ActiveRecord::Callbacks
45
56
  extend ActiveRecord::Callbacks::ClassMethods
46
- extend Translation
57
+ extend ActiveRecord::Translation
58
+
59
+ # copied from .gem_rbs_collection/activestorage/7.0/lib/engine.rbs
60
+ # which for some reason does not get included
61
+ include ::ActiveStorage::Attached::Model
62
+ extend ::ActiveStorage::Attached::Model::ClassMethods
63
+ include ::ActiveStorage::Reflection::ActiveRecordExtensions
47
64
 
48
- def self.set_callback
65
+ class << self
66
+ # included in ActiveRecordExtensions
67
+ # @return [Hash{String => ActiveStorage::Reflection::HasOneAttachedReflection, ActiveStorage::Reflection::HasManyAttachedReflection}]
68
+ attr_accessor :attachment_reflections
49
69
  end
70
+
71
+ extend ::ActiveStorage::Reflection::ActiveRecordExtensions::ClassMethods
72
+
73
+ def self.set_callback; end
74
+
75
+ # @return [:activerecord]
76
+ def self.i18n_scope; end
77
+
78
+ # @return [self]
79
+ def reload(); end
50
80
  end
51
81
 
52
82
  module ActiveRecord::Validations
53
83
  # @return [Boolean]
54
- def validate; end
84
+ def validate(); end
55
85
  end
56
86
 
57
87
  # @!override ActiveRecord::Batches#find_each
@@ -0,0 +1,113 @@
1
+ module ActiveStorage
2
+ # Provides the class-level DSL for declaring an Active Record model's attachments.
3
+ module Attached
4
+ module Model
5
+ # NOTE: the below would normally be in a ClassMethods module -
6
+ # but Solargraph currently uses yard-activesupport-concern,
7
+ # which jams the method in as class methods under this module.
8
+ #
9
+ # Specifies the relation between a single attachment and the model.
10
+ #
11
+ # class User < ApplicationRecord
12
+ # has_one_attached :avatar
13
+ # end
14
+ #
15
+ # There is no column defined on the model side, Active Storage takes
16
+ # care of the mapping between your records and the attachment.
17
+ #
18
+ # To avoid N+1 queries, you can include the attached blobs in your query like so:
19
+ #
20
+ # User.with_attached_avatar
21
+ #
22
+ # Under the covers, this relationship is implemented as a +has_one+ association to a
23
+ # ActiveStorage::Attachment record and a +has_one-through+ association to a
24
+ # ActiveStorage::Blob record. These associations are available as +avatar_attachment+
25
+ # and +avatar_blob+. But you shouldn't need to work with these associations directly in
26
+ # most circumstances.
27
+ #
28
+ # The system has been designed to having you go through the ActiveStorage::Attached::One
29
+ # proxy that provides the dynamic proxy to the associations and factory methods, like +attach+.
30
+ #
31
+ # If the +:dependent+ option isn't set, the attachment will be purged
32
+ # (i.e. destroyed) whenever the record is destroyed.
33
+ #
34
+ # If you need the attachment to use a service which differs from the globally configured one,
35
+ # pass the +:service+ option. For instance:
36
+ #
37
+ # class User < ActiveRecord::Base
38
+ # has_one_attached :avatar, service: :s3
39
+ # end
40
+ #
41
+ # If you need to enable +strict_loading+ to prevent lazy loading of attachment,
42
+ # pass the +:strict_loading+ option. You can do:
43
+ #
44
+ # class User < ApplicationRecord
45
+ # has_one_attached :avatar, strict_loading: true
46
+ # end
47
+ #
48
+
49
+ # @param name [String, Symbol]
50
+ # @param dependent [Symbol] the action to take on the attachment when the record is destroyed
51
+ # @param strict_loading [Boolean]
52
+ # @param service [String, Symbol, nil] the service to use for the attachment
53
+ # @return [void]
54
+ def self.has_one_attached(name, dependent: :default, service: nil, strict_loading: false); end
55
+
56
+ # Specifies the relation between multiple attachments and the model.
57
+ #
58
+ # class Gallery < ApplicationRecord
59
+ # has_many_attached :photos
60
+ # end
61
+ #
62
+ # There are no columns defined on the model side, Active Storage takes
63
+ # care of the mapping between your records and the attachments.
64
+ #
65
+ # To avoid N+1 queries, you can include the attached blobs in your query like so:
66
+ #
67
+ # Gallery.where(user: Current.user).with_attached_photos
68
+ #
69
+ # Under the covers, this relationship is implemented as a +has_many+ association to a
70
+ # ActiveStorage::Attachment record and a +has_many-through+ association to a
71
+ # ActiveStorage::Blob record. These associations are available as +photos_attachments+
72
+ # and +photos_blobs+. But you shouldn't need to work with these associations directly in
73
+ # most circumstances.
74
+ #
75
+ # The system has been designed to having you go through the ActiveStorage::Attached::Many
76
+ # proxy that provides the dynamic proxy to the associations and factory methods, like +#attach+.
77
+ #
78
+ # If the +:dependent+ option isn't set, all the attachments will be purged
79
+ # (i.e. destroyed) whenever the record is destroyed.
80
+ #
81
+ # If you need the attachment to use a service which differs from the globally configured one,
82
+ # pass the +:service+ option. For instance:
83
+ #
84
+ # class Gallery < ActiveRecord::Base
85
+ # has_many_attached :photos, service: :s3
86
+ # end
87
+ #
88
+ # If you need to enable +strict_loading+ to prevent lazy loading of attachments,
89
+ # pass the +:strict_loading+ option. You can do:
90
+ #
91
+ # class Gallery < ApplicationRecord
92
+ # has_many_attached :photos, strict_loading: true
93
+ # end
94
+ #
95
+ # @param name [String, Symbol]
96
+ # @param dependent [Symbol] the action to take on the attachment when the record is destroyed
97
+ # @param strict_loading [Boolean]
98
+ # @param service [String, Symbol, nil] the service to use for the attachment
99
+ # @return [void]
100
+ def self.has_many_attached(name, dependent: :default, service: nil, strict_loading: false); end
101
+
102
+ # @return [void]
103
+ def self.attachment_changes(); end
104
+
105
+ # @return [Boolean]
106
+ def self.changed_for_autosave?; end
107
+
108
+ # @param lock [BasicObject]
109
+ # @return [self]
110
+ def self.reload(lock = false); end
111
+ end
112
+ end
113
+ end
@@ -1,3 +1,7 @@
1
1
  class Array
2
2
  def sum; end
3
+
4
+ # @param format [Symbol]
5
+ # @return [String]
6
+ def to_formatted_s(format = :some_default); end
3
7
  end
@@ -23,9 +23,17 @@ class Date
23
23
 
24
24
  # @return [::Time]
25
25
  def to_time; end
26
+
27
+ # @param format [Symbol]
28
+ # @return [String]
29
+ def to_formatted_s(format = :some_default); end
26
30
  end
27
31
 
28
32
  class DateTime
29
33
  # @return [String]
30
34
  def readable_inspect; end
35
+
36
+ # @param format [Symbol]
37
+ # @return [String]
38
+ def to_formatted_s(format = :some_default); end
31
39
  end
@@ -11,4 +11,8 @@ end
11
11
  class Rails::Application
12
12
  # @return [ActionDispatch::Routing::RouteSet]
13
13
  def routes; end
14
+ # @return [Rails::Application::Configuration]
15
+ def config; end
16
+ # @return [Rails::Application::Configuration]
17
+ def self.config; end
14
18
  end
@@ -24,6 +24,10 @@ class Time
24
24
 
25
25
  # @return [Time]
26
26
  def to_time; end
27
+
28
+ # @param format [Symbol]
29
+ # @return [String]
30
+ def to_formatted_s(format = :some_default); end
27
31
  end
28
32
 
29
33
  # @!override Time#+
@@ -1,5 +1,5 @@
1
1
  module Solargraph
2
2
  module Rails
3
- VERSION = '1.2.0'
3
+ VERSION = '1.2.1'
4
4
  end
5
5
  end
@@ -11,12 +11,6 @@ solargraph_version =
11
11
  [
12
12
  # below this isn't tested in CI
13
13
  '>= 0.48.0',
14
- # did not have support for global conventions
15
- '!=0.53.0', '!=0.53.1', '!=0.53.2', '!=0.53.3', '!=0.53.4',
16
- # did not have support for global conventions
17
- '!=0.54.0', '!=0.54.1', '!=0.54.2', '!=0.54.3', '!=0.54.4', '!=0.54.5',
18
- # did not have support for global conventions
19
- '!=0.55.0', '!=0.55.1', '!=0.55.2', '!=0.55.3', '!=0.55.4', '!=0.55.5', '!=0.55.6', '!=0.55.7',
20
14
  # above this hasn't been tested
21
15
  '< 0.57'
22
16
  ]
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solargraph-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fritz Meissner
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-07-02 00:00:00.000000000 Z
10
+ date: 2025-08-24 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -100,14 +99,14 @@ dependencies:
100
99
  requirements:
101
100
  - - '='
102
101
  - !ruby/object:Gem::Version
103
- version: 0.56.0
102
+ version: 0.57.alpha
104
103
  type: :runtime
105
104
  prerelease: false
106
105
  version_requirements: !ruby/object:Gem::Requirement
107
106
  requirements:
108
107
  - - '='
109
108
  - !ruby/object:Gem::Version
110
- version: 0.56.0
109
+ version: 0.57.alpha
111
110
  - !ruby/object:Gem::Dependency
112
111
  name: activesupport
113
112
  requirement: !ruby/object:Gem::Requirement
@@ -131,9 +130,8 @@ extensions: []
131
130
  extra_rdoc_files: []
132
131
  files:
133
132
  - ".github/ISSUE_TEMPLATE/bug_report.md"
134
- - ".github/workflows/overcommit.yml"
135
- - ".github/workflows/rubocop.yml"
136
- - ".github/workflows/ruby.yml"
133
+ - ".github/workflows/linter.yml"
134
+ - ".github/workflows/test.yml"
137
135
  - ".github/workflows/typecheck.yml"
138
136
  - ".gitignore"
139
137
  - ".overcommit.yml"
@@ -162,8 +160,11 @@ files:
162
160
  - lib/solargraph/rails/annotations/action_controller.rb
163
161
  - lib/solargraph/rails/annotations/action_dispatch.rb
164
162
  - lib/solargraph/rails/annotations/action_mailer.rb
163
+ - lib/solargraph/rails/annotations/action_text.rb
164
+ - lib/solargraph/rails/annotations/active_job.rb
165
165
  - lib/solargraph/rails/annotations/active_model.rb
166
166
  - lib/solargraph/rails/annotations/active_record.rb
167
+ - lib/solargraph/rails/annotations/active_storage.rb
167
168
  - lib/solargraph/rails/annotations/active_support.rb
168
169
  - lib/solargraph/rails/annotations/array.rb
169
170
  - lib/solargraph/rails/annotations/class.rb
@@ -190,7 +191,6 @@ homepage: https://github.com/iftheshoefritz/solargraph-rails
190
191
  licenses:
191
192
  - MIT
192
193
  metadata: {}
193
- post_install_message:
194
194
  rdoc_options: []
195
195
  require_paths:
196
196
  - lib
@@ -205,8 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  requirements: []
208
- rubygems_version: 3.3.27
209
- signing_key:
208
+ rubygems_version: 3.6.6
210
209
  specification_version: 4
211
210
  summary: Solargraph plugin that adds Rails-specific code through a Convention
212
211
  test_files: []
@@ -1,31 +0,0 @@
1
- # npm install -g act
2
- # act pull_release -j 'runner / rubocop'
3
- ---
4
- name: reviewdog
5
- on:
6
- pull_request:
7
- permissions:
8
- contents: read
9
- pull-requests: write
10
- jobs:
11
- rubocop:
12
- name: runner / rubocop
13
- runs-on: ubuntu-latest
14
- env:
15
- BUNDLE_ONLY: rubocop
16
- steps:
17
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18
- - uses: ruby/setup-ruby@1a615958ad9d422dd932dc1d5823942ee002799f # v1.227.0
19
- with:
20
- ruby-version: '3.3'
21
- bundler-cache: true
22
- - uses: reviewdog/action-rubocop@fcb74ba274da10b18d038d0bcddaae3518739634 # v2.21.2
23
- with:
24
- reporter: github-pr-review # Default is github-pr-check
25
- skip_install: true
26
- use_bundler: true
27
- rubocop_extensions: 'rubocop-performance:gemfile rubocop-rspec:gemfile rubocop-rake:gemfile'
28
- fail_on_error: true
29
- fail_level: info
30
- rubocop_version: Gemfile
31
- level: info