Suppose a model has two child models of the same type, but two different classifications, for example, Shop has two ShippingOptions , but one of them is international and one local
In other words, you know that it will always have exactly two, one international and one local,
it is good practice or it is even possible to do the following:
shop.rb
has_one :shipping_option, :as => :international_shipping_option has_one :shipping_option, :as => :local_shipping_option
Otherwise, how it should be handled (best practice)
ruby-on-rails ruby-on-rails-3
Marco prins
source share