ruby on rails - Alternative to STI model -


i have project user can manage (crud) 1 or n clients. each of have 1 type; either natural person or legal person.

i thought creating client model type column in order use sti pattern; while having 2 classes np , lp inherit client.

i did research sti concept , this article has convinced me go different approach. main reason 2 models np , lp, not have many fields in common, , want avoid having many columns null value in db.

so wondering how can have user managing client whether natural or legal person.

thanks help


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -