annotaterb 4.17.0 → 4.19.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8789a11055d7fe2e2631a4c8ca0b3e05e20e365c16a31a2ea21ba6c1f90eda60
4
- data.tar.gz: cbd50d2e0be48c2ffc55c600b5e1a5d6ae5864224d04180924a473395c1543eb
3
+ metadata.gz: '0759110968217261a67bb8c519e55398ff9f43392e6cc4771bbebf5f97ce0395'
4
+ data.tar.gz: d179acc1d279901b547475d5ee87d46346d671e083ef233d2e65e1a7c8d3f277
5
5
  SHA512:
6
- metadata.gz: a51864d58bb429fd7166c16c98e179c926b5d2cf06b294f7b476f36e6dce5662d5f3ea20881ef0ac773535f3ccd3ddf4e26d35d833ba813bbc955a38191a2ea5
7
- data.tar.gz: 78349c0ac08e212a9c6c0d40315d4bb18eba61e0dea77a580c133b76235a04cd3e78072c6d85814d3081de3e7c53eaa19e7297f9148e3c45bfe8567cbe7ce559
6
+ metadata.gz: 8c0c8deaf4685925e3992f0adc33ecc2d92c49049eea38e44881d510b06128e031569ab242b80e160d534b369985a4eb9bb28612682d10c7a4e254f18030078e
7
+ data.tar.gz: 1f37df086f3c6afd475e684bdc8458fd3ffe70ff245f2dc6b14786cd889e3b2107269064344f79c27425f46e0f599b3a6d3d4e7662844523c7a22bd799c49fc5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,63 @@
1
1
  # Changelog
2
2
 
3
+ ## [v4.18.0](https://github.com/drwl/annotaterb/tree/v4.18.0) (2025-08-04)
4
+
5
+ [Full Changelog](https://github.com/drwl/annotaterb/compare/v4.17.0...v4.18.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Feature request: support for multi database [\#188](https://github.com/drwl/annotaterb/issues/188)
10
+
11
+ **Closed issues:**
12
+
13
+ - Does not run on rollback with multiple databases [\#244](https://github.com/drwl/annotaterb/issues/244)
14
+ - classified\_sort and polymorphic associations [\#236](https://github.com/drwl/annotaterb/issues/236)
15
+ - --show-migration also annotates the primary DB's schema version for models referencing the secondary DB [\#233](https://github.com/drwl/annotaterb/issues/233)
16
+ - Annotations are not added on top of model files when columns'`comment:` contains Japanese characters in migrations [\#200](https://github.com/drwl/annotaterb/issues/200)
17
+ - Feature: further customization to achieve more compact annotations [\#150](https://github.com/drwl/annotaterb/issues/150)
18
+ - Version 5 change list [\#127](https://github.com/drwl/annotaterb/issues/127)
19
+ - Reformat Column Comments [\#117](https://github.com/drwl/annotaterb/issues/117)
20
+
21
+ **Merged pull requests:**
22
+
23
+ - Bump version to v4.18.0 [\#246](https://github.com/drwl/annotaterb/pull/246) ([drwl](https://github.com/drwl))
24
+ - Run on rollback in app with multiple databases [\#245](https://github.com/drwl/annotaterb/pull/245) ([z1lk](https://github.com/z1lk))
25
+ - Speed up AnnotationDecider [\#243](https://github.com/drwl/annotaterb/pull/243) ([DRBragg](https://github.com/DRBragg))
26
+ - Add AnnotateRb::Runner.running? method [\#242](https://github.com/drwl/annotaterb/pull/242) ([thewatts](https://github.com/thewatts))
27
+ - fix: --show-migration to use per-model database connections [\#241](https://github.com/drwl/annotaterb/pull/241) ([OdenTakashi](https://github.com/OdenTakashi))
28
+ - Fix: Support Japanese characters in column names [\#239](https://github.com/drwl/annotaterb/pull/239) ([tonystrawberry](https://github.com/tonystrawberry))
29
+ - Fix classified\_sort to group polymorphic association columns together [\#238](https://github.com/drwl/annotaterb/pull/238) ([garriguv](https://github.com/garriguv))
30
+ - Generate changelog for v4.17.0 [\#235](https://github.com/drwl/annotaterb/pull/235) ([drwl](https://github.com/drwl))
31
+
32
+ ## [v4.17.0](https://github.com/drwl/annotaterb/tree/v4.17.0) (2025-07-14)
33
+
34
+ [Full Changelog](https://github.com/drwl/annotaterb/compare/v4.16.0...v4.17.0)
35
+
36
+ **Implemented enhancements:**
37
+
38
+ - Place column comments at the end of the line \(feature suggestion\) [\#164](https://github.com/drwl/annotaterb/issues/164)
39
+
40
+ **Fixed bugs:**
41
+
42
+ - Model annotation chokes on an empty file [\#182](https://github.com/drwl/annotaterb/issues/182)
43
+
44
+ **Closed issues:**
45
+
46
+ - uninitialized constant Zeitwerk::VERSION [\#216](https://github.com/drwl/annotaterb/issues/216)
47
+ - Incorrect annotation of fixture files when different models share the same table name in different databases [\#206](https://github.com/drwl/annotaterb/issues/206)
48
+ - Should active record and active support be in the gemspec? [\#197](https://github.com/drwl/annotaterb/issues/197)
49
+
50
+ **Merged pull requests:**
51
+
52
+ - Bump version to v4.17.0 [\#234](https://github.com/drwl/annotaterb/pull/234) ([drwl](https://github.com/drwl))
53
+ - Fix NoMethodError when processing empty files [\#232](https://github.com/drwl/annotaterb/pull/232) ([tanukiti1987](https://github.com/tanukiti1987))
54
+ - Refactor column ignore to use `match?` [\#231](https://github.com/drwl/annotaterb/pull/231) ([tagliala](https://github.com/tagliala))
55
+ - Fix standard configuration [\#230](https://github.com/drwl/annotaterb/pull/230) ([tagliala](https://github.com/tagliala))
56
+ - Generate changelog for v4.16.0 [\#229](https://github.com/drwl/annotaterb/pull/229) ([drwl](https://github.com/drwl))
57
+ - show included columns in indexes [\#211](https://github.com/drwl/annotaterb/pull/211) ([pineman](https://github.com/pineman))
58
+ - fix: use model name for file retrieval when not connected to the primary DB. [\#207](https://github.com/drwl/annotaterb/pull/207) ([OdenTakashi](https://github.com/OdenTakashi))
59
+ - Place column comments at the end of the line [\#199](https://github.com/drwl/annotaterb/pull/199) ([Adeynack](https://github.com/Adeynack))
60
+
3
61
  ## [v4.16.0](https://github.com/drwl/annotaterb/tree/v4.16.0) (2025-06-18)
4
62
 
5
63
  [Full Changelog](https://github.com/drwl/annotaterb/compare/v4.15.0...v4.16.0)
data/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  ## AnnotateRb
2
+
2
3
  ### forked from the [Annotate aka AnnotateModels gem](https://github.com/ctran/annotate_models)
3
4
 
4
5
  A Ruby Gem that adds annotations to your Rails models and route files.
5
6
 
6
- ----------
7
+ ---
8
+
7
9
  [![CI](https://github.com/drwl/annotaterb/actions/workflows/ci.yml/badge.svg)](https://github.com/drwl/annotaterb/actions/workflows/ci.yml)
8
10
  [![Gem Version](https://badge.fury.io/rb/annotaterb.svg)](https://badge.fury.io/rb/annotaterb)
9
11
 
@@ -32,7 +34,9 @@ The schema comment looks like this:
32
34
  class Task < ApplicationRecord
33
35
  ...
34
36
  ```
35
- ----------
37
+
38
+ ---
39
+
36
40
  ## Installation
37
41
 
38
42
  ```sh
@@ -46,11 +50,12 @@ group :development do
46
50
  ...
47
51
 
48
52
  gem "annotaterb"
49
-
53
+
50
54
  ...
51
55
  ```
52
56
 
53
57
  ### Automatically annotate models
58
+
54
59
  For Rails projects, model files can get automatically annotated after migration tasks. To do this, run the following command:
55
60
 
56
61
  ```sh
@@ -66,6 +71,7 @@ $ ANNOTATERB_SKIP_ON_DB_TASKS=1 bin/rails db:migrate
66
71
  ```
67
72
 
68
73
  ### Added Rails generators
74
+
69
75
  The following Rails generator commands get added.
70
76
 
71
77
  ```sh
@@ -83,18 +89,23 @@ AnnotateRb:
83
89
  ```
84
90
 
85
91
  `bin/rails g annotate_rb:config`
92
+
86
93
  - Generates a new configuration file, `.annotaterb.yml`, using defaults from the gem.
87
94
 
88
95
  `bin/rails g annotate_rb:hook`
96
+
89
97
  - Installs the Rake file to automatically annotate Rails models on a database task (e.g. AnnotateRb will automatically run after running `bin/rails db:migrate`).
90
98
 
91
99
  `bin/rails g annotate_rb:install`
100
+
92
101
  - Runs the `config` and `hook` generator commands
93
102
 
94
103
  `bin/rails g annotate_rb:update_config`
104
+
95
105
  - Appends to `.annotaterb.yml` any configuration key-value pairs that are used by the Gem. This is useful when there's a drift between the config file values and the gem defaults (i.e. when new features get added).
96
106
 
97
107
  ## Migrating from the annotate gem
108
+
98
109
  Refer to the [migration guide](MIGRATION_GUIDE.md).
99
110
 
100
111
  ## Usage
@@ -103,7 +114,7 @@ AnnotateRb has a CLI that you can use to add or remove annotations.
103
114
 
104
115
  ```sh
105
116
  # To show the CLI options
106
- $ bundle exec annotaterb
117
+ $ bundle exec annotaterb
107
118
 
108
119
  Usage: annotaterb [command] [options]
109
120
 
@@ -127,6 +138,7 @@ Annotate model options:
127
138
  Complete foreign key names in the annotation
128
139
  -i, --show-indexes List the table's database indexes in the annotation
129
140
  -s, --simple-indexes Concat the column's related indexes in the annotation
141
+ -c, --show-check-constraints List the table's check constraints in the annotation
130
142
  --hide-limit-column-types VALUES
131
143
  don't show limit for given column types, separated by commas (i.e., `integer,boolean,text`)
132
144
  --hide-default-column-types VALUES
@@ -134,7 +146,15 @@ Annotate model options:
134
146
  --ignore-unknown-models don't display warnings for bad model files
135
147
  -I, --ignore-columns REGEX don't annotate columns that match a given REGEX (i.e., `annotate -I '^(id|updated_at|created_at)'`
136
148
  --with-comment include database comments in model annotations
137
- --with-column-comments include column comments in model annotations
149
+ --without-comment include database comments in model annotations
150
+ --with-column-comments include column comments in model annotations
151
+ --without-column-comments exclude column comments in model annotations
152
+ --position-of-column-comments VALUE
153
+ set the position, in the annotation block, of the column comment
154
+ --with-table-comments include table comments in model annotations
155
+ --without-table-comments exclude table comments in model annotations
156
+ --classes-default-to-s class Custom classes to be represented with `to_s`, may be used multiple times
157
+ --nested-position Place annotations directly above nested classes or modules instead of at the top of the file.
138
158
 
139
159
  Annotate routes options:
140
160
  Usage: annotaterb routes [options]
@@ -157,6 +177,7 @@ Additional options that work for annotating models and routes
157
177
  --ignore-model-subdirects Ignore subdirectories of the models directory
158
178
  --sort Sort columns alphabetically, rather than in creation order
159
179
  --classified-sort Sort columns alphabetically, but first goes id, then the rest columns, then the timestamp columns and then the association columns
180
+ --grouped-polymorphic Group polymorphic associations together in the annotation when using --classified-sort
160
181
  -R, --require path Additional file to require before loading models, may be used multiple times
161
182
  -e [tests,fixtures,factories,serializers],
162
183
  --exclude Do not annotate fixtures, test files, factories, and/or serializers
@@ -176,6 +197,8 @@ Additional options that work for annotating models and routes
176
197
  Place the annotations at the top (before) or the bottom (after) of the routes.rb file
177
198
  --ps, --position-in-serializer [before|top|after|bottom]
178
199
  Place the annotations at the top (before) or the bottom (after) of the serializer files
200
+ --pa, --position-in-additional-file-patterns [before|top|after|bottom]
201
+ Place the annotations at the top (before) or the bottom (after) of files captured in additional file patterns
179
202
  --force Force new annotations even if there are no changes.
180
203
  --debug Prints the options and outputs messages to make it easier to debug.
181
204
  --frozen Do not allow to change annotations. Exits non-zero if there are going to be changes to files.
@@ -185,6 +208,7 @@ Additional options that work for annotating models and routes
185
208
  ## Configuration
186
209
 
187
210
  ### Storing default options
211
+
188
212
  Previously in the [Annotate](https://github.com/ctran/annotate_models) you could pass options through the CLI or store them as environment variables. Annotaterb removes dependency on the environment variables and instead can read values from a `.annotaterb.yml` file stored in the Rails project root.
189
213
 
190
214
  ```yml
@@ -198,6 +222,7 @@ Annotaterb reads first the configuration file, if it exists, passes its content
198
222
  For further details visit the [section in the migration guide](MIGRATION_GUIDE.md#automatic-annotations-after-running-database-migration-commands).
199
223
 
200
224
  ### How to skip annotating a particular model
225
+
201
226
  If you want to always skip annotations on a particular model, add this string
202
227
  anywhere in the file:
203
228
 
@@ -211,6 +236,10 @@ migrations were run).
211
236
  If you prefer to sort alphabetically so that the results of annotation are
212
237
  consistent regardless of what order migrations are executed in, use `--sort`.
213
238
 
239
+ You can also sort columns by type, then alphabetically using `--classified-sort`
240
+ and `--grouped-polymorphic`: first goes id, then the rest columns, then the
241
+ timestamp columns and then the association columns.
242
+
214
243
  ## License
215
244
 
216
245
  Released under the same license as Ruby. No Support. No Warranty.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.17.0
1
+ 4.19.0
@@ -7,17 +7,16 @@ module AnnotateRb
7
7
  def call(options)
8
8
  options[:require].count > 0 && options[:require].each { |path| require path }
9
9
 
10
- if defined?(::Rails::Application)
11
- if defined?(::Zeitwerk)
12
- # Delegate to Zeitwerk to load stuff as needed
13
- else
14
- klass = ::Rails::Application.send(:subclasses).first
15
- klass.eager_load!
16
- end
10
+ if defined?(::Zeitwerk)
11
+ # Delegate to Zeitwerk to load stuff as needed
12
+ # (Supports both Rails and non-Rails applications)
13
+ elsif defined?(::Rails::Application)
14
+ klass = ::Rails::Application.send(:subclasses).first
15
+ klass.eager_load!
17
16
  else
18
17
  model_files = ModelAnnotator::ModelFilesGetter.call(options)
19
18
  model_files&.each do |model_file|
20
- require model_file
19
+ require File.join(*model_file)
21
20
  end
22
21
  end
23
22
  end
@@ -59,17 +59,7 @@ module AnnotateRb
59
59
  end
60
60
 
61
61
  def build
62
- if @options.get_state(:current_version).nil?
63
- migration_version = begin
64
- ActiveRecord::Migrator.current_version
65
- rescue
66
- 0
67
- end
68
-
69
- @options.set_state(:current_version, migration_version)
70
- end
71
-
72
- version = @options.get_state(:current_version)
62
+ version = @model.migration_version
73
63
  table_name = @model.table_name
74
64
  table_comment = @model.connection.try(:table_comment, @model.table_name)
75
65
  max_size = @model.max_schema_info_width
@@ -17,36 +17,25 @@ module AnnotateRb
17
17
  begin
18
18
  klass = ModelClassGetter.call(@file, @options)
19
19
 
20
- klass_is_a_class = klass.is_a?(Class)
21
- # Methods such as #superclass only exist on a class. Because of how the code is structured, `klass` could be a
22
- # module that does not support the #superclass method, so we want to return early.
23
- return false if !klass_is_a_class
20
+ return false unless klass.respond_to?(:descends_from_active_record?)
24
21
 
25
- klass_inherits_active_record_base = klass < ActiveRecord::Base
26
- klass_is_not_abstract = klass.respond_to?(:abstract_class?) && !klass.abstract_class?
27
- klass_table_exists = klass.respond_to?(:table_exists?) && klass.table_exists?
28
-
29
- not_sure_this_conditional = (!@options[:exclude_sti_subclasses] || !(klass.superclass < ActiveRecord::Base && klass.table_name == klass.superclass.table_name))
30
-
31
- annotate_conditions = [
32
- klass_is_a_class,
33
- klass_inherits_active_record_base,
34
- not_sure_this_conditional,
35
- klass_is_not_abstract,
36
- klass_table_exists
37
- ]
22
+ # Skip annotating STI classes
23
+ if @options[:exclude_sti_subclasses] && !klass.descends_from_active_record?
24
+ return false
25
+ end
38
26
 
39
- to_annotate = annotate_conditions.all?
27
+ return false if klass.abstract_class?
28
+ return false unless klass.table_exists?
40
29
 
41
- return to_annotate
30
+ return true
42
31
  rescue BadModelFileError => e
43
32
  unless @options[:ignore_unknown_models]
44
33
  warn "Unable to process #{@file}: #{e.message}"
45
- warn "\t" + e.backtrace.join("\n\t") if @options[:trace]
34
+ warn "\t#{e.backtrace.join("\n\t")}" if @options[:trace]
46
35
  end
47
36
  rescue => e
48
37
  warn "Unable to process #{@file}: #{e.message}"
49
- warn "\t" + e.backtrace.join("\n\t") if @options[:trace]
38
+ warn "\t#{e.backtrace.join("\n\t")}" if @options[:trace]
50
39
  end
51
40
 
52
41
  false
@@ -55,9 +44,9 @@ module AnnotateRb
55
44
  private
56
45
 
57
46
  def file_contains_skip_annotation
58
- file_string = File.exist?(@file) ? File.read(@file) : ""
47
+ return false unless File.exist?(@file)
59
48
 
60
- /#{SKIP_ANNOTATION_PREFIX}.*/o.match?(file_string)
49
+ /#{SKIP_ANNOTATION_PREFIX}.*/o.match?(File.read(@file))
61
50
  end
62
51
  end
63
52
  end
@@ -11,8 +11,7 @@ module AnnotateRb
11
11
  # - "# status(a/b/c) :string not null"
12
12
  # - "# created_at :datetime not null"
13
13
  # - "# updated_at :datetime not null"
14
- COLUMN_PATTERN = /^#[\t ]+[\w*.`\[\]():]+(?:\(.*?\))?[\t ]+.+$/
15
-
14
+ COLUMN_PATTERN = /^#[\t ]+[[\p{L}\p{N}_]*.`\[\]():]+(?:\(.*?\))?[\t ]+.+$/
16
15
  class << self
17
16
  def call(file_content, annotation_block)
18
17
  new(file_content, annotation_block).generate
@@ -32,9 +32,8 @@ module AnnotateRb
32
32
  warn "Either specify models on the command line, or use the --model-dir option."
33
33
  warn "Call 'annotaterb --help' for more info."
34
34
  # exit 1 # TODO: Return exit code back to caller. Right now it messes up RSpec being able to run
35
- else
36
- model_files
37
35
  end
36
+ model_files
38
37
  end
39
38
 
40
39
  private
@@ -28,7 +28,7 @@ module AnnotateRb
28
28
  end
29
29
 
30
30
  cols = cols.sort_by(&:name) if @options[:sort]
31
- cols = classified_sort(cols) if @options[:classified_sort]
31
+ cols = classified_sort(cols, @options[:grouped_polymorphic]) if @options[:classified_sort]
32
32
 
33
33
  cols
34
34
  end
@@ -177,7 +177,7 @@ module AnnotateRb
177
177
  @position_of_column_comment ||= @options[:position_of_column_comment]
178
178
  end
179
179
 
180
- def classified_sort(cols)
180
+ def classified_sort(cols, grouped_polymorphic)
181
181
  rest_cols = []
182
182
  timestamps = []
183
183
  associations = []
@@ -186,6 +186,8 @@ module AnnotateRb
186
186
  # specs don't load defaults, so ensure we have defaults here
187
187
  timestamp_columns = @options[:timestamp_columns] || DEFAULT_TIMESTAMP_COLUMNS
188
188
 
189
+ col_names = cols.map(&:name)
190
+
189
191
  cols.each do |c|
190
192
  if c.name.eql?("id")
191
193
  id = c
@@ -193,6 +195,9 @@ module AnnotateRb
193
195
  timestamps << c
194
196
  elsif c.name[-3, 3].eql?("_id")
195
197
  associations << c
198
+ elsif c.name[-5, 5].eql?("_type") && col_names.include?(c.name.sub(/_type$/, "_id")) && grouped_polymorphic
199
+ # This is a polymorphic association's type column
200
+ associations << c
196
201
  else
197
202
  rest_cols << c
198
203
  end
@@ -216,6 +221,28 @@ module AnnotateRb
216
221
  @klass.name.foreign_key.to_sym
217
222
  ]
218
223
  end
224
+
225
+ def migration_version
226
+ return 0 unless @options[:include_version]
227
+
228
+ # Multi-database support: Cache migration versions per database connection to handle
229
+ # different schema versions across primary/secondary databases correctly.
230
+ # Example: primary → "current_version_primary", secondary → "current_version_secondary"
231
+ connection_pool_name = connection.pool.db_config.name
232
+ cache_key = "current_version_#{connection_pool_name}".to_sym
233
+
234
+ if @options.get_state(cache_key).nil?
235
+ migration_version = begin
236
+ connection.migration_context.current_version
237
+ rescue
238
+ 0
239
+ end
240
+
241
+ @options.set_state(cache_key, migration_version)
242
+ end
243
+
244
+ @options.get_state(cache_key)
245
+ end
219
246
  end
220
247
  end
221
248
  end
@@ -41,6 +41,7 @@ module AnnotateRb
41
41
  format_rdoc: false, # ModelAnnotator
42
42
  format_yard: false, # ModelAnnotator
43
43
  frozen: false, # ModelAnnotator, but should be used by both
44
+ grouped_polymorphic: false, # ModelAnnotator
44
45
  ignore_model_sub_dir: false, # ModelAnnotator
45
46
  ignore_unknown_models: false, # ModelAnnotator
46
47
  include_version: false, # ModelAnnotator
@@ -113,6 +114,7 @@ module AnnotateRb
113
114
  :format_rdoc,
114
115
  :format_yard,
115
116
  :frozen,
117
+ :grouped_polymorphic,
116
118
  :ignore_model_sub_dir,
117
119
  :ignore_unknown_models,
118
120
  :include_version,
@@ -407,6 +407,11 @@ module AnnotateRb
407
407
  @options[:classified_sort] = true
408
408
  end
409
409
 
410
+ option_parser.on("--grouped-polymorphic",
411
+ "Group polymorphic associations together in the annotation when using --classified-sort") do
412
+ @options[:grouped_polymorphic] = true
413
+ end
414
+
410
415
  option_parser.on("-R",
411
416
  "--require path",
412
417
  "Additional file to require before loading models, may be used multiple times") do |path|
@@ -418,9 +423,9 @@ module AnnotateRb
418
423
  end
419
424
 
420
425
  option_parser.on("-e",
421
- "--exclude [tests,fixtures,factories,serializers]",
426
+ "--exclude [tests,fixtures,factories,serializers,sti_subclasses]",
422
427
  Array,
423
- "Do not annotate fixtures, test files, factories, and/or serializers") do |exclusions|
428
+ "Do not annotate fixtures, test files, factories, serializers, and/or sti subclasses") do |exclusions|
424
429
  exclusions ||= EXCLUSION_LIST
425
430
  exclusions.each { |exclusion| @options["exclude_#{exclusion}".to_sym] = true }
426
431
  end
@@ -3,9 +3,23 @@
3
3
  module AnnotateRb
4
4
  class Runner
5
5
  class << self
6
+ attr_reader :runner
7
+
6
8
  def run(args)
7
- new.run(args)
9
+ self.runner = new
10
+
11
+ runner.run(args)
12
+
13
+ self.runner = nil
8
14
  end
15
+
16
+ def running?
17
+ !!runner
18
+ end
19
+
20
+ private
21
+
22
+ attr_writer :runner
9
23
  end
10
24
 
11
25
  def run(args)
@@ -18,7 +18,7 @@ if defined?(Rails::Application) && Rails.version.split(".").first.to_i >= 6
18
18
 
19
19
  # If there's multiple databases, this appends database specific rake tasks to `migration_tasks`
20
20
  ActiveRecord::Tasks::DatabaseTasks.for_each(databases) do |database_name|
21
- migration_tasks.concat(%w[db:migrate db:migrate:up db:migrate:down].map { |task| "#{task}:#{database_name}" })
21
+ migration_tasks.concat(%w[db:migrate db:migrate:up db:migrate:down db:rollback].map { |task| "#{task}:#{database_name}" })
22
22
  end
23
23
  end
24
24
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: annotaterb
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.17.0
4
+ version: 4.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew W. Lee
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-07-14 00:00:00.000000000 Z
11
+ date: 2025-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord