-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
ruby
model.add_to_set :set, 1, 2
TypeError Exception: can't convert Symbol into Integer
Note that passing an array [1,2] will add an array to the set.
mongoDB supports multiple arguments to addToSet.
http://www.mongodb.org/display/DOCS/Updating#Updating-%24addToSet
Is there a way to do this in mongoid currently? If not I would consider the current API to have a defect- at a minimum instead of a TypeError there should be an error: "multiple values not supported..."