annotate_models icon indicating copy to clipboard operation
annotate_models copied to clipboard

Position option: before class definition

Open istrasci opened this issue 5 years ago • 0 comments

It would be nice if you had an additional position option to insert the annotation immediately before a class definition. If I have a class defined within a module (or several modules) and the annotation goes at the top, the YARD documentation tool (and possibly other documentation tools) will see the annotation as the documentation for the module, NOT for the model class.

So if my model is defined like this:

# Annotate will put model
# annotation here, but the YARD
# tool will see this as the
# documentation for the module
#

module MyModule

  # I would like annotate
  # to put the model annotation
  # here instead so that it's
  # seen as the documentation
  # for the model class

  class SomeModel < ApplicationRecord
    # ...model definition
  end
end

Version

  • annotate-3.0.2
  • rails-5.2.3
  • ruby-2.6.4

istrasci avatar Oct 01 '19 23:10 istrasci