drwl / annotaterb

A Ruby Gem that adds annotations to your Rails models and route files.
Other
191 stars 18 forks source link

Correct uses of `respond_to` in AnnotationDecider #131

Closed andreccosta closed 4 months ago

andreccosta commented 4 months ago

In our project we have more than just Active Record models within our models folder. After switching to this gem we noticed a couple errors being raised when attempting to decide if some of those should be annotated or not.

For example, a class that inherits from Dry::Struct responds to abstract_class but not to abstract_class?.

> class Demo < Dry::Struct; end
> Demo.abstract_class
=> Dry::Struct
> Demo.abstract_class?
(irb):3:in `<main>': undefined method `abstract_class?' for class Demo (NoMethodError)
drwl commented 4 months ago

@andreccosta thanks for trying out this gem and submitting a PR, it's very much appreciated.

Changes look good to me!

drwl commented 4 months ago

@andreccosta just a heads up, I published v4.10.1 to Rubygems and it includes this fix.

andreccosta commented 4 months ago

@drwl thank you!