yard and annotate for models in a namespace

59 Views Asked by At

I am trying to use the annotate gem with the -f yard option. This works quite well for models in the toplevel of the folder. However a lot of my models are in a namespace. The annotate gem will create the information on top of the file and yard is not picking that up as a description of the model.

Is there a way to bring the annotation directly in front of the class?

bundle exec annotate --models -f yard

Leads to

# frozen_string_literal: true

# == Schema Information
#
# Table name: a_bs
#
# @!attribute id
#   @return []
# @!attribute date
#   @return [Date]
# @!attribute created_at
#   @return [Time]
# @!attribute updated_at
#   @return [Time]
module A
  class B < ApplicationRecord
  end
end
0

There are 0 best solutions below