tapioca icon indicating copy to clipboard operation
tapioca copied to clipboard

Don't skip over abstract FrozenRecord classes

Open amomchilov opened this issue 3 years ago • 4 comments

Motivation

On shop-server, we have an abstract! base class that derives from FrozenRecord::Base.

Currently, this class doesn't have an RBI file generated, because the FrozenRecord Tapioca compiler is explicitly skipping over abstract classes.

I don't think there's a reason not to include these, so let's just do it.

Tests

There wasn't a test to check that abstract classes are skipped. If there was one, I would have deleted it. I don't think there's a need to add a test to verify that's we're not not including abstract files, but LMK if you think I should add one anyway :)

amomchilov avatar Aug 05 '22 19:08 amomchilov

Did we test this PR agains our monolith? I think it might have a reason why we skip abstract classes.

rafaelfranca avatar Aug 09 '22 16:08 rafaelfranca

@rafaelfranca Vinicius suggested that offline. When I have time, I'll run it against core. I'll put this in draft until then.

amomchilov avatar Aug 09 '22 16:08 amomchilov

We also do this for descendants of ActiveRecord::Base. I wonder if it's worth considering that as well?

sambostock avatar Oct 07 '22 01:10 sambostock

We actually moved away from having that abstract base class. There were other edge-cases in FrozenRecord that made it more painful than it was worth. I won't have time to investigate this before BFCM, so perhaps we could just close this issue

(Although not skipping them still might make sense as a default, unless we have an explicit reason to want to skip them)

amomchilov avatar Oct 12 '22 15:10 amomchilov