Skip to content

Conversation

@jdart
Copy link

@jdart jdart commented Sep 12, 2025

No description provided.

drwl pushed a commit that referenced this pull request Jan 2, 2026
## Summary

Fix `NoMethodError: undefined method 'to_yard'` when using YARD or RDoc
format options.

  Closes #212

  ## Problem

When running `annotaterb models --format-yard` on a model with indexes,
foreign keys, or check constraints:

  NoMethodError: undefined method 'to_yard' for an instance of
  AnnotateRb::ModelAnnotator::IndexAnnotation::Annotation

  ## Solution

  Added `to_yard` and `to_rdoc` methods to:
  - `IndexAnnotation::Annotation`
  - `ForeignKeyAnnotation::Annotation`
  - `CheckConstraintAnnotation::Annotation`

  ## Related

- Related to #266 (had syntax error and missing
`CheckConstraintAnnotation`)

  ## Test

- [x] Added unit tests for `to_yard` and `to_rdoc` in all three
annotation specs
@drwl
Copy link
Owner

drwl commented Jan 2, 2026

Closing as I merged in #302

@drwl drwl closed this Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants