开发者

Rails plugin to find missing foreign keys

开发者 https://www.devze.com 2023-03-14 09:38 出处:网络
W开发者_运维技巧hat I have: A big rails app using ar 2.3.11 & postgresql 8.4 db What I need:

W开发者_运维技巧hat I have: A big rails app using ar 2.3.11 & postgresql 8.4 db

What I need: Any gem/plugin/library that look for entire models with associations and provide me a list of missing foreign keys


If you can't find it, it shouldn't be hard to implement by yourself, for example as Rake task. You should iterate over all your classes (you need to know model classes before, but maybe there is a way to get list of your models somehow from Rails), call #reflections on all model class and then extract necessary informations.

But if you'll find already implemented solution, then I'll be happy to check it on my old projects too.

0

精彩评论

暂无评论...
验证码 换一张
取 消