data.split.each do |x| val = Obj.find(:first, :conditions => ['name = ?', x]) val ||= Obj.new(:name => x) val.save @collection.vals<< val end @collection.save