Why you should avoid nested STI | ActiveRecord, Rails 6

Nested Single Table Inheritance doesn’t work well. Here’s what you must know to make it work or work around it. Initial specifications: a project owner creates a project and donors can contribute.Later, a little change was made to the specifications: a donor may either be a natural person (an individual human) or a legal person (a corporation or any other kind of legal entity).Since both are donors and will share some significant amount of logic, it seems obvious that they are both a specialization of User::Donor, hence:.
Why you should avoid nested STI | ActiveRecord, Rails 6 #ruby #rubydeveloper #rubyonrails #activerecord, https://rubyonrails.ba/single/why-you-should-avoid-nested-sti-activerecord-rails-6

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles