class Icecream include CheckboxSetHelper has_many :flavours checkbox_set 'flavour_choice' # Example hook to apply the set to a has_many # relationship. Kept simple for illustrative purposes, # could be more efficient (only create/delete changes) def after_save self.flavours.clear self.flavour_choices.each do |flavour_id| self.flavours.create(:flavour_id => flavour_id) end end end