viafintech / tidus

ActiveRecord database anonymization using views
MIT License
13 stars 4 forks source link

STI support #13

Closed archgrove closed 6 years ago

archgrove commented 7 years ago

In trying to use Tidus, we've discovered a problem with Rail's Single Table Inheritance (http://api.rubyonrails.org/classes/ActiveRecord/Inheritance.html). At the moment, the Rake tasks look for all Active Model subclasses, and attempt to create views for each via table_name. The ends up exploding when a model inheritance chain is established, as in STI.

The "correct" thing to do here is not entirely obvious. We're having to solve this problem in our own anonymisation, and I suspect I'll end up switching on the type field of the row. If we have time to generalise this, would you be open to a PR?

tobischo commented 7 years ago

Yes, of course, you could use skip_anonymization though to prevent this.

tobischo commented 7 years ago

@archgrove Did using skip_anonymization resolve the issue for you or are you planning on making a pull request?

tobischo commented 6 years ago

Closing due to lack of activity