On Thu, May 10, 2012 at 10:57 AM, Mauro <mrsan...@gmail.com> wrote: > I have problems on a simple design problem. > I have many companies. Each company have one or more commercial activity. > Activities types are: ecommerce, local unit, television, automatic > vending machines, and so on. >
So can each Company have many CommercialActivities Then.. CommercialActivity is STI, which means it has a type column and sub-types can be ECommerceActivity, TelevisionActivity, etc.. The only warning is that if each type is dramatically different, you might want to investigate doing it with multiple tables so you dont have a lot of redundant fields trying model things with additional attributes that aren't shared. I think this post might help you http://stackoverflow.com/questions/1634668/multiple-table-inheritance-vs-single-table-inheritance-in-ruby-on-rails -- Greg Akins http://twitter.com/akinsgre -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.