Hello all,
I have the following models:
class Sku < ActiveRecord::Base has_and_belongs_to_many :options end class Option < ActiveRecord::Base has_and_belongs_to_many :skus end
By default if I destroy an Option any relationships between Options and Skus will be removed as well.
But, I want to prevent an Option from being destroyed when it is associated with a Sku in the options_skus table. So the only way to destroy an Option is to first remove each relationship. Is this possible to do in the model? Is there a particular Rails way to do it?
Thanks for any help or suggestions you may have!
Ian Neubert