mobility icon indicating copy to clipboard operation
mobility copied to clipboard

add writer plugin type checking option

Open GeorgeGorbanev opened this issue 2 years ago • 0 comments

Hi!

Some time ago I have discovered an issue with one of my job rails project. It was translated with Mobility using Postgres jsonb backend. So one of model attributes was used as one type in some places and different in another. And it was hard to figure out what type it was originally 😬

I thought if with jsonb we losing traditional active record type castings and sql checkings why dont to add some basic checkings on library level? Of course it would be nice if my specific problem was prevented by properly testing or .rbs annotations or even just human comment after translates expression... but it was't. And I guess not only in my project.

So I decided to propose you type checking feature in writer plugin. I think this tiny but intelligent option will encourage developers to make them models more safely, explicit and reliable. Even when they can't for some reason write tests and types annotations :)

And thank you for this gem and your job!

GeorgeGorbanev avatar Sep 19 '22 18:09 GeorgeGorbanev